问题
Ok there was question like that but situation was different - I want to use build - in OS-X Apache (2.4) and PHP installed by Homebrew (5.6).
So I put this is httpd.conf
LoadModule php5_module /usr/local/opt/php56/libexec/apache2/libphp5.so
And when i restart Apache I get this
httpd: Syntax error on line 118 of /usr/local/etc/apache2/2.2/httpd.conf: Cannot load /usr/local/opt/php56/libexec/apache2/libphp5.so into server: dlopen(/usr/local/opt/php56/libexec/apache2/libphp5.so, 10): Symbol not found: _ap_unixd_config\n Referenced from: /usr/local/opt/php56/libexec/apache2/libphp5.so\n Expected in: /usr/local/Cellar/httpd22/2.2.29/bin/httpd\n in /usr/local/opt/php56/libexec/apache2/libphp5.so
Also First I have installed apache2.2 by homebrew as well. But I decided to remove it and used build-in one. But despite that I removed this in homebrew it is still there. So I have two apache and I am not really sure how to remove 2.2 version.
Can you please help me with these? I tried everything my knowledge allows me to do, so please let me seek yours
回答1:
If apache can't find libphp5.so there is no libphp5.so on given path.
uninstall php56: brew uninstall php56
install php56 again with Apache option: brew install php56 --with-apache
At the end of installation you can look at summary of installation (last line of terminal output) to find out where libphp5.so is installed (im my case in /usr/local/Cellar/php56/5.6.32_8).
Now you should find libphp5.so in /usr/local/Cellar/php56/5.6.32_8/libexec/apache2
来源:https://stackoverflow.com/questions/31215575/cant-load-installed-php-version-in-apache-homebrew-os-x