Mac System Configuration PHP Environment

Source: Internet
Author: User
Tags configuration php php write phpmyadmin

"Written in front--jutting."

-_-#急着配环境的同志们可以绕道. Recently, the school's laboratory took a small project-time card system, the use of RFID in the hardware layer to obtain the student card ID, through the WiFi transmission to the server, the attendance information storage, the mobile phone side to obtain the server data. I am responsible for the software part and another hardware child paper together to achieve this small project, but the baby did not write the interface before, and PHP write communication interface is relatively light, the library is more complete, the use of PHP to write app interface! Nonsense not much to say, we started the following configuration.

Our configuration for this article draws from:

http://my.oschina.net/joanfen/blog/171109

Since it is a reference, I will not face to the article set as "original", plus the process of their own operation, hope everyone light spray t_t ...

Operating system

I am using Mac OS 10.10.5.

Figure 1-1 Mac operating system

"Start Apache"

First we start the Apache service that comes with the system.

Open terminal and enter the following command:

Open Apache Service sudo apachectl start//view Apache version number sudo apachectl-v


We'll see what it looks like:

Figure 1-2 Terminal enter command to open Apache Service and view version number

We then verify that the Apache service we opened is ready to use, open the browser and enter:

http://localhost


We will see this information in our browser:

Figure 1-3 Apache successfully opened

"Run PHP"

Before running our PHP, we need to change our PHP configuration file, open Finder, "Go to Folder ...", enter:

/etc/apache2/

Figure 2-1 Go to the PHP configuration folder and find our httpd.conf profile: Figure 2-2 httpd.conf configuration file using a text editor, uncomment our line below:
LoadModule Php5_module libexec/apache2/libphp5.so

Figure 2-3 After modifying the profile configuration file, we simply reboot our Apache service and let the changes take effect, in terminal input:
sudo apachectl restart

Next we want to know the version of PHP on our Mac. We enter in Terminal:
Copy the Index.html.en file and rename it to info.php in the root directory of Apache. sudo cp/library/webserver/documents/index.html.en/library/webserver/documents/info.php

Open our info.php file and add it with a text editor after "It Works":
<?php phpinfo ();?>
Then restart our Apache again. After rebooting, we enter in the browser URL bar:
http://localhost/info.php

We can see: Figure 2-4 PHP version and related information "installation configuration MySQL" MySQL installation configuration we see: http://www.cnblogs.com/macro-cheng/archive/2011/10/25/ mysql-001.html "Using phpMyAdmin" phpMyAdmin is a common tool used in the PHP development process. First of all, we download phpMyAdmin and download it on our website phpmyadmin:http://www.phpmyadmin.net/home_page/ Downloads.php Choose the right version for our download, because our PHP version is 5.5.29, so we download support 5.5~7.0 version of phpMyAdmin: Figure 4-1 phpmyadmin download Download our phpMyAdmin, Unzip the downloaded file: Figure 4-2 Download and unzip the pypmyadmin file into the "/library/webserver/documents/" folder with the pressurized file, and name it phpmyadmin: Figure 4-3 put in the specified folder, and change the name to phpMyAdmin replication/library/webserver/documents/ phpMyAdmin in the config.sample.inc.php, and named Config.inc.php, and placed under the current folder: Figure 4-4 Copy the config.sample.inc.php file and change the name to config.inc.php into the current folder and edit our config.inc.php file as follows:
$cfg[' Servers '] $i [' host '] = ' localhost '; change to: $cfg [' Servers '] $i] [' host '] = ' 127.0.0.1 ';

Figure 4-5 Modifying localhost to 127.0.0.1 if you want to log on without a password, change the false in the following statement to true: Figure 4-6 Set the password-free login to enter in the browser:
Http://localhost/phpmyadmin
Enter the user name "root", and the password you just changed, if the password is not changed, follow the no password action in the previous step, and then you can log in directly.

"quote from the original author."PHP development also need to download a PHP development tools, Mac PHP development tools are also quite a lot, we Google Baidu, we need to remind that, after installing the development tools, in the proposed PHP project, remember to put the project in and phpmyadmin the same directory file, Can create a new folder specifically for the PHP project, otherwise, it will not work (a big God, I have not personally verified)

Mac System Configuration PHP Environment

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.