OS X comes with apache and php installed, but not enabled. While it's quite easy to get the Apache server up and running, through system preferences -> Sharing -> check "Web Sharing". You still have to then enable the php5 module. This is done by editing the file /etc/apache2/httpd.conf and uncommenting (removing the # from) the line "LoadModule php5_module libexec/apache2/libphp5.so"
Don't forget to restart apache with "sudo apachectl restart"
Post new comment