.This document uses Mac OS X 10.6.3 and10.8.1For example. The main content includes:
!"Page, which is located under"/Library (resource Library)/WebServer/Documents/", which is the default root directory of Apache.
.It is worth noting that when Mac OS X cancels "Web Sharing" in 10.8, the "/Users/[user name]/Sites/" directory is also removed, so 10.Access "http: // [local IP address]/~ [User name] "will display" 403 Forbidden ", but http: // [local IP address]/can still be accessed.Go to "system preference settings"> "Security"> "Firewall", enable the Firewall, and then click "Firewall Options) click block all incoming connections..You can also set httpd. conf to only allow localhost and 127.0.0.1 access "/Library (resource Library)/WebServer/Documents /".
<Directory "/Library/WebServer/Documents"> ...... # # Controls who can get stuff from this server. # Order allow,deny #Allow from all Allow from 127.0.0.1 Allow from localhost </Directory>
.5.MySQL provides installation instructions for Mac OS X.
Warning: The/usr/local/mysql/data directory is not owned by the 'mysql' or '_ mysql'", This should be caused by some circumstances/usr/local/mysql/data
The host has changed, just run"sudo chown -R mysql /usr/local/mysql/data
"..
.0.0.1. The reason is that php searches for the connection by default./var/mysql/mysql.sock
But MYSQL for MAC changed the file location and put it under/tmp..The solution is to modify php. ini as follows:
mysql.default_socket = /tmp/mysql.sock
.Using phpMyAdmin to manage MySQL is a very effective way to verify the effect of the previous steps.
Extension
.However, the installation in Mac OS X is not so friendly, as follows:
Http: // localhost/phpmyadmin"The mcrypt extension cannot be loaded. Please check your PHP configuration..The message "no" indicates that the MCrypt extension library has been successfully installed. If it cannot be loaded, try to addextension
To:
extension=/usr/lib/php/extensions/no-debug-non-zts-20090626/mcrypt.so
.8 & 10.7 Development Server and Adding MCRYPT to your OSX Lion PHP install
.6.3 and 10.8.1 are supported by the Central Plains. For more information, see "Mac OS X Leopard: Configure Apache, PHP, SQLite, MySQL, and phpMyAdmin (1) "and" Mac OS X Leopard: Configure Apache, PHP, SQLite, MySQL, and phpMyAdmin (2 )".In fact, you can also use an integrated solution provided by a third party such as XAMPP or MacPorts for simple installation and use..