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

Ok, there was such a question, but the situation was different: I want to use embedded OS-X Apache (2.4) and PHP installed by Homebrew (5.6).

So, I put this 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 installed apache2.2 over homebrew. But I decided to remove it and use the built-in one. But even though I removed this in homebrew, it is still there. So I have two apaches and I am not sure how to remove version 2.2.

Could you help me with this? I've tried everything that allows me to do, so please let me search yours.

+3


source to share


1 answer


If apache cannot find libphp5.so, then libfp5.so will not be on the given path.



  • remove php56: brew remove php56

  • install php56 again with Apache option: brew install php56 --with-apache

  • At the end of the installation, you can see the installation summary (last line of terminal output) to see where libphp5.so is installed (im my case in / usr / local / Cellar / php 56 / 5.6. 32_8).

  • You should now find libphp5.so in / usr / local / Cellar / php 56 / 5.6.32_8 / libexec / apache2

0


source







All Articles