Run "sudo apachectl start" and enter your account password so that Apache runs.
Run "sudo apachectl-v" and you will see the Apache version number in Mac OS X 10.6.3:
Server version:apache/2.2.14 (Unix)
Server Built:feb 11 2010 14:40:31
This allows you to enter "http://localhost" in the browser, and you can see that a content "It works!" appears Page, which is located under "/library (Resource Library)/webserver/documents/", which is the default root directory for Apache.
Run "sudo vi/etc/apache2/httpd.conf" in the terminal to open the Apache configuration file.
Find "#LoadModule php5_module libexec/apache2/libphp5.so", remove the previous #, Save (enter: W at the command line) and Exit VI (enter: Q on the command line).
Run "sudo cp/etc/php.ini.default/etc/php.ini" so that you can configure various PHP functions via php.ini.
Run "sudo apachectl restart" and restart Apache so PHP is ready to use.
Run "cp/library/webserver/documents/index.html.en/library/webserver/documents/info.php", That is, copy the Index.html.en file and rename it to info.php in the root directory of Apache.
Run "vi/library/webserver/document/info.php" in the terminal so that you can edit the info.php file in VI. In "It s works!" Add the following "<?php Phpinfo ();?>" and save it. This allows you to see information about PHP in http://localhost/info.php, such as the version number 5.3.1.
Install Apache+php+mysql under Mac