22

So I've upgraded to Mavericks (or maybe Yosemite) yesterday but now I only get a view of my directory when I visit localhost but the included index.php isn't executed anymore.

I have to uncommented the virtualhosts line in /etc/apache2/httpd.conf

# Virtual hosts
Include /private/etc/apache2/extra/httpd-vhosts.conf

so my virtual hosts work but php doesn't get executed.

2 Answers 2

48

Found the solution:

Have to uncomment this line in /etc/apache2/httpd.conf as well:

LoadModule php5_module libexec/apache2/libphp5.so

Don't forget to restart Apache after changes:

sudo apachectl restart
20

This did the trick for me:

sudo cp /etc/apache2/httpd.conf.pre-update /etc/apache2/httpd.conf

Basically restores your previous config. Not sure why this doesnt happen by default - But o well.

UPDATE: Same for the php.ini file:

sudo cp /etc/php.ini-5.2-previous /etc/php.ini
3
  • Thanks.. had to do something similar for my php.ini config.. see update. Oct 29, 2013 at 18:40
  • 1
    This solved my 403 Forbidden problem after updating to Mavericks. Thanks!
    – robodasha
    Nov 6, 2013 at 15:23
  • 2
    For me it the name for the previous httpd.conf file was different: sudo cp /etc/apache2/httpd.conf~previous /etc/apache2/httpd.conf
    – Nick
    Nov 20, 2013 at 17:36

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.