Mac OS X comes with Apache and PHP, but is not turned on by default, this article explains how to enable both services, the environment is based on MAC OS x 10.6 Snow Leopard.
Launch Apache
The command line method is to open the terminal, the Apache service requires root permission to start, so execute the following command:
sudo apachectl start
Enable PHP
Modify the Apache configuration file, the path is/etc/apache2/httpd.conf, remove the comment (#) about the line of PHP:
LoadModule Php5_module libexec/apache2/libphp5.so
Then restart Apache:
sudo apachectl restart
Now visit the website of this machine try: http://localhost/
The default Web site root directory is/library/webserver/documents, in this directory a PHP file (so info.php) to test PHP, the file content is as simple as:
Visit this page http://localhost/info.php
The configuration information of the real PHP
Mac OS X enable Apache and PHP