Howto set up PHP on Mac OS X
From How2s
Switching on the web server on mac os x is pretty simple: go to the system preferences, open the "sharing" pane and enable "personal web sharing".
You can now access your webroot by typing "localhost" into your browser's location bar.
Now you want to customize your configuration: Change the webroot and enabling PHP (http://www.php.net)
- I tend to create a folder called /wwwroot/ in my root directory (Macintosh HD)
- Open the terminal and type
open /etc/httpd/httpd.conf
to open the configuration file of your webserver.
- Where it sais "DocumentRoot", change the path to the path of your desire. I set it to the one I have just created
DocumentRoot "/wwwroot"
- Search for the two lines
#LoadModule php4_module libexec/httpd/libphp4.so
...
#AddModule mod_php4.c
and uncomment them by removing the # in front of it. They then should look like
LoadModule php4_module libexec/httpd/libphp4.so
...
AddModule mod_php4.c
- That's it (if you are running mac os x 10.2 or older, you will have to follow more instructions (http://the.taoofmac.com/space/HOWTO/Enable%20PHP%20on%20Mac%20OS%20X)) ... you just have to restart your server now for the changes to take action. Go to the terminal and type
sudo /System/Library/StartupItems/Apache/Apache restart
... and you're done.

