Configure the Apache + Php + Mysql environment on Mac, and configure Apache and PHP.
Same as OSX, Mavericks comes with apache2.2.24 and php5.4.17, but it is not enabled by default. Open the terminal
sudo apachectl start
Enter localhost in the browser, and apache standard It Works will appear!
Next, enable php and modify the apache configuration file.
sudo vim /etc/apache2/httpd.conf
Find
# LoadModule php5_module libexec/apache2/libphp5.so, remove the previous #
The default www folder is very inconvenient, but it is easy to develop it in home, modifying apache configuration
, Or the above File
# Change the directory in the quotation marks to your own directory DocumentRoot "/Library/WebServer/Documents"... # change the directory in the quotation marks to the same directory as the one above.
Create File index. php In your directory and write
Accessing localhost in a browser should display the php info page
Installation and configuration of MySQL and phpMyAdmin
Go to the MySQL official website to download the latest MySQL version ghost. For ease of operation, you can add an alias for MySQL:
alias mysql=/usr/local/mysql/bin/mysqlalias mysqladmin=/usr/local/mysql/bin/mysqladmin
Set the password later
Mysqladmin-uroot password "password"
For convenience, you can use phpMyAdmin for graphical operations.
Success!
Ps: Reprinted from http://www.kankanews.com/ICkengine/archives/100966.shtml