You will need to find the httpd.conf file and load the php module. The http.conf file should be in /etc/apache2/httpd.conf. Find the following line and uncomment it (remove the ”#” character at the start of the line):
#LoadModule php5_module libexec/apache2/libphp5.so
This should enable PHP. You'll need to restart Apache for the change to take effect. This can be done by unchecking and rechecking the web sharing setting in your Sharing Settings.