localhost doesn't execute php files after update to Maverick/Yosemite OS

我们两清 提交于 2019-12-03 18:48:14

问题


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.


回答1:


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



回答2:


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


来源:https://stackoverflow.com/questions/19584893/localhost-doesnt-execute-php-files-after-update-to-maverick-yosemite-os

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!