Once I've upgraded to Yosemite my PHP stopped working. After a quick search I've found this guide which worked fine on my work computer.

When I tried the same on my home Mac, it didn't work. 1) on my home Mac I had entropy PHP initially installed, so I followed they guide to uninstall and install a newer version but that didn't work.

I've also tried with standard PHP that came out of the box and that didn't work either.

To clarify: I've cleaned install Yosemite then I imported my user and settings. I've uncommented this line on httpd.conf

LoadModule userdir_module libexec/apache2/mod_userdir.so as well as these two:

LoadModule authz_core_module libexec/apache2/mod_authz_core.so
LoadModule authz_host_module libexec/apache2/mod_authz_host.so

I don't want to use the user's Site (i.e.: localhost/~user/myphpapp) and would rather use (localhost/myphpapp) but I did followed the instructions to set users' Site and that didn't work either. (I then reverted back)

To clarify what it means it doesn't work: when I go to localhost/php/info.php (where info.php has phpinfo() in it) I can the string <?php phpinfo(); ?> but it doesn't execute. When I navigate through my apps, the files are visible, which tells me apache is working fine, just PHP isn't executing the files.

Another point is that php itself is installed. executing php --version on terminal gives me the following:

PHP 5.6.2 (cli) (built: Oct 21 2014 21:47:13)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2014 Zend Technologies
with Zend OPcache v7.0.4-dev, Copyright (c) 1999-2014, by Zend Technologies
with Xdebug v2.2.5, Copyright (c) 2002-2014, by Derick Rethans

and which php


my httpd.conf:

LoadModule php5_module /usr/local/php5/libphp5.so

which is what entropy gave me after installing its script. I can see the libphp5.so in the above directory (its actually a symlink but thats fine I guess)

When I execute sudo apachectl -t I get a Syntax OK and yes, I did restart apache after my last round of changes. Have even restarted the computer to be sure.

Lastly, when I execute php app/console server:run from a symfony app, it does work as expected, PHP is definitely in and working fine.

My only guess is the my httpd.conf is broken somehow but I don't know how to fix.

Can anyone please shed some light on this?

Mny thanks

  • I just ran into this issue when I installed Yosemite recently. Have you since resolved it? Many thanks - Grant – grant Jan 6 '15 at 17:05
  • The problem was indeed in the .httpd.cnf file. Once I've reverted it to the original (there is a original file created) all got back to normal – WagnerMatosUK Jan 17 '15 at 11:41

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.