I'm trying to run Apache in Mac OSX Yosemite using MacPorts' PHP (mod_php53.so). Note that I'm not using MacPorts' Apache but Yosemite's Apache with MacPorts' PHP. This was working fine with OSX Mavericks and Mountain Lion in the past.
I get this error when running /usr/sbin/apachectl -t in Yosemite:
httpd: Syntax error on line 228 of /private/etc/apache2/httpd.conf: Cannot load /opt/local/apache2/modules/mod_php53.so into server: dlopen(/opt/local/apache2/modules/mod_php53.so, 10): Library not loaded: /opt/local/lib/libaprutil-1.0.dylib\n Referenced from: /opt/local/apache2/modules/mod_php53.so\n Reason: Incompatible library version: mod_php53.so requires version 6.0.0 or later, but libaprutil-1.0.dylib provides version 4.0.0
In fact, /opt/local/lib/libaprutil-1.0.dylib current version is 6.4.0, so it should work.
otool -L /opt/local/lib/libaprutil-1.0.dylib
/opt/local/lib/libaprutil-1.0.dylib:
/opt/local/lib/libaprutil-1.0.dylib (compatibility version 6.0.0, current version 6.4.0)
I guess that Apache is loading the system's libaprutil-1.0.dylib located in /usr/lib:
otool -L /usr/lib/libaprutil-1.0.dylib
/usr/lib/libaprutil-1.0.dylib:
/usr/lib/libaprutil-1.0.dylib (compatibility version 4.0.0, current version 4.0.0)
This is confusing because the error message clearly states that MacPorts' libaprutil was not load because of version incompatibility but I guess it is trying to use the system's libaprutil and don't know how to force Apache to load MacPorts' libaprutil.
I already tried to set the DYLD_LIBRARY_PATH environment variable, but that did not help.
Any ideas?