macOS Sierra comes with PHP 5.6 and I wanted to upgrade it to the latest stable version of PHP (7.1.4) by building from the source. What I did was actually a fresh install. First, I removed the old PHP from my system and then download the source code from the php.net and built it. Things work fine except for Apache.
By the way, before I built the PHP, I had to install apr
and apr-util packages
. The PHP 7 didn't just accept the same packages under the /usr/lib
which come with OS by default.
When I execute configtest, I receive this error:
httpd: Syntax error on line 175 of /private/etc/apache2/httpd.conf:
Cannot load libexec/apache2/libphp7.so into server:
dlopen(/usr/libexec/apache2/libphp7.so, 10):
Library not loaded: /usr/local/apr/lib/libaprutil-1.0.dylib
Referenced from: /usr/libexec/apache2/libphp7.so
Reason: Incompatible library version:
libphp7.so requires version 6.0.0 or later, but libaprutil-1.0.dylib provides version 4.0.0
For some reason, libaprutil-1.0.dylib is not loaded into my environment under /usr/local/apr/lib/
and that's why I cannot start Apache.
I saw similar problem here and tried to do the accepted solution. However, I still couldn't manage to start it.
Any ideas why it cannot load libaprutil
?