Mac OS X ships with apache pre-installed, however the files have been in non-standard locations. This is really a spot to collect details about where configuration files live, and just how to tweak the apache installation to complete such things as serve php pages.

Apache Config file is: /private/etc/apache2/httpd.conf

Default DocumentRoot is: /Library/Webserver/Documents/

Make it possible for PHP, around line 114 (maybe) within the /private/etc/apache2/httpd.conf file may be the following line:

#LoadModule php5_module     libexec/apache2/

Take away the pound sign to uncomment the road now it appears such as this:

LoadModule php5_module     libexec/apache2/

Restart Apache: System Preferences -> Discussing -> Not-check "Web Discussing" and re-check it. OR

$ sudo apachectl restart


$ httpd -V

will highlight plenty of helpful server information, including in which the httpd.conf file are available.

httpd.conf is within /private/etc/apache2

Enable PHP by uncommenting line:

 LoadModule php5_module        libexec/apache2/

/etc/httpd/customers consists of user-specific configuration files which may be used to override the worldwide configuration. For instance, adding "AddHandler server-parsed html" towards the <Directory> block within the /etc/httpd/customers/*.conf file that corresponds to 1 user will enable mod_include parsing of HTML files for your particular user's $HOME/Sites directory, but nowhere else.

To obtain SSI/includes (mod_include) to operate I discovered I needed to edit /private/etc/apache2/customers/myusername.conf and alter AllowOverride None to AllowOverride All.

Adding the next inside a .htaccess file within the cause of your website:

Options +Includes

AddType text/html .html

AddOutputFilter INCLUDES .html