Can't load installed PHP version in Apache (Homebrew OS X)

纵饮孤独 提交于 2019-12-10 19:19:13

问题


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.

  1. uninstall php56: brew uninstall php56

  2. install php56 again with Apache option: brew install php56 --with-apache

  3. 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).

  4. 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

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