OK, so I'v installed php5 and apache2 on my OS X using macports. php is running fine from the terminal, as is apache. I've edited my httpd.conf file to add the following:
LoadModule php5_module modules/libphp5.so
AddType application/x-httpd-php .php [I have also tried AddHandler here to no avail]
<IfModule dir_module>
DirectoryIndex index.php index.html
</IfModule>
Apache will redirect to an index.html file in the local root, but will not redirect to index.php. it just shows the list of files in the directory, and clicking on index.php will just output the contents of the file in plaintext. It's as if my httpd.conf changes aren't even being read. But I've searched and there are no other versions of httpd.conf stored anywhere on my system, bar one file named 'httpd.conf.bak', in my /opt/local/apache2/conf/ folder. Can anyone help?