Configuring Apache and PHP on Yosemite

In order to get PHP working with Apache, I needed to add the following code to /usr/local/etc/apache2/2.4/httpd.conf:

In the DirectoryIndex:

<IfModule dir_module>
    DirectoryIndex index.html index.php

In the LoadModules section:

LoadModule php5_module /usr/local/opt/php56/libexec/apache2/

After restarting Apache, my test.php file was not displaying phpinfo() data, so I had to add the following right after the LoadModule:

AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps

Installing LAMP stack on OSX Mavericks with Homebrew

This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *