Max is from the server with Apache and PHP, do not need to install additional, this article on the relevant configuration is described.
First: Apache
Enter the terminal and the following command will launch the Apache server:
Start sudo apachectl-k start //restart sudo apachectl-k restart
Verify:
Enter in the browser: http://127.0.0.1, displayed as it works! , both of which prove that the server has started.
But because the default site is located under the system path, we modify the path to the custom. So you need to configure it.
To modify the site location:
Input in terminal
Cd/etc/apache2/sudo vim httpd.conf//will prompt for a password, enter after entering enter:/documentroot, find, Note: 1: Attention to case-sensitive, 2: To modify two places, it is required to make two searches.
After the first lookup, modify:
After the second lookup, modify the
After modification: Wq save exit, restart the server, and place the HTML file under the custom path to access.
Second: Configure the PHP server:
1: Input command in terminal:
Cd/etc/apache2 sudo vim httpd.conf press/php to search, put with loadmodule php5 ... this line of # (note symbol) is removed.![] (http://images.cnitblog.com/blog2015/589133/201503/231410352395226.png)
2: Enter in Terminal:
Cd/etc/sudo CP Php.ini.default PHP.ini
You can access PHP content by restarting the server and placing PHP files under a custom site path.
Third: MYSQ Installation:
MySQL Download: http://dev.mysql.com/downloads/mysql/MySqlWorkbench download: http://dev.mysql.com/downloads/workbench/
Install directly after download, all the way by default
MySQL configuration:
Open Terminal, enter:
Vim ~/.bash_profile
Enter I for editing, then paste the following
# mysqlalias mysql= '/usr/local/mysql/bin/mysql ' Alias mysqladmin= '/usr/local/mysql/bin/mysqladmin ' # lsalias ls= ' ls- G
Press the ESC key, enter: Wq
In this way, you can enter MySQL directly in the terminal. Enter Exit for exit
Modify the MySQL administrator password and enter it in the terminal:
Mysqladmin-u root Password "root" start MySQL service sudo/library/startupitems/mysqlcom/mysqlcom start stop MySQL service sudo /library/startupitems/mysqlcom/mysqlcom stop restart MySQL service sudo/library/startupitems/mysqlcom/mysqlcom restart
At this point, the apache+mysql+php installation configuration is complete.
Attached: Introduction to the VIM editor
There are two modes of vim:
1: Command mode
Shift+v, select a row y---Copy a line yy----Copy the current row (Yank-line) p---copy and paste the contents of the next row of the current row x, delete one character: Wq, save exit: Q! , do not save exit I, enter edit/--Press/re-enter characters to find
2: Edit mode, can edit document directly, press ESC to exit edit mode
The above describes the Mac under the Apache+mysql+php development environment installation process, including the apache,mysql aspects of the content, I hope that the PHP tutorial interested in a friend helpful.