Reputation: 215
i want to use osx built-in apache with the php version from homebrew. If I modify /etc/apache2/httpd.conf so that the homebrew php is loaded, then no site is available not even localhost.
LoadModule php5_module /usr/local/Cellar/php55/5.5.13/libexec/apache2/libphp5.so
apachectl status tells me that apache is running. It works if I use the default path. Do you have any suggestions to solve this problem?
Upvotes: 4
Views: 2564
Reputation: 1332
I had the same problem. Homebrew added
LoadModule php5_module local/Cellar/php56/5.6.8/libexec/apache2/libphp5.so
to httpd.conf. I changed this line to
LoadModule php5_module /usr/local/opt/php56/libexec/apache2/libphp5.so
and restart apache. It works for me
Upvotes: 2
Reputation: 12388
As shevron already stated, you have to get rid of the built-in-apache, and brew the apache from homebrew and reinstall (or "re-brew") php then with
brew install -v php55 --homebrew-apxs --with-apache
Follow this detailled tutorial:
https://echo.co/blog/os-x-109-local-development-environment-apache-php-and-mysql-homebrew
Upvotes: 0
Reputation: 3663
I'm guessing libphp5.so
from homebrew is compiled against the homebrew Apache, which may not be binary compatible with the OS X provided built-in Apache. You should probably stick to the Homebrew Apache - in fact I would suggest sticking to Homebrew for your entire stack (or using a whole different approach such as MAMP, a Vagrant box, etc.)
Upvotes: 1