(1) Open Apache (because the Mac comes with Apache, so it only needs to be turned on)
--In the terminal input, prompted to enter the password.
sudo apachectl-k start
--Verify: Enter 127.0.0.1 or localhost in the browser to display "It works! "That means success.
--Change the default address, the configuration file in the/ect/apache2/in the httpd.conf, note the above two sentences, add the following two sentences. (The address below is our own definition of the new address, the future projects are here to do)
#DocumentRoot "/library/webserver/documents" #<directory "/library/webserver/documents" >documentroot "/Users /andy/site "<directory"/users/andy/site ">
--After the change is complete, restart the Apache server sudo apachectl-k restart
(2) Installing MySQL
--Download to MySQL website, preferably download in DMG format (http://dev.mysql.com/downloads/mysql/)
--then install, three files are installed.
--Modify aliases in terminal
CD to current user directory vim. Bash_profile#mysqlalias mysql= '/usr/local/mysql/bin/mysql ' Alias mysqladmin= '/usr/local/mysql/bin/ Mysqladmin ' #lsalias ls= ' ls-g '
--Use the previous alias to set the Administrator password (only the PHP script can access the database if the password is set)
mysqladmin-u root Password "123456"
(3) can use Navicat to manage database
(4) Open PHP
--In the/ect/apache2/of the httpd.conf, the following sentence to cancel the previous # can,
LoadModule Php5_module libexec/apache2/libphp5.so
--also need to change the configuration information file to INI format in/ect/
sudo cp php.ini.default php.ini
"iOS Dev-92" on Mac How to build Apache+php+mysql environment for iOS network testing?