Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

PHP 5.3.3 compiled on Mac OS X 10.6 - using /usr/lib when trying to start Apache... rather than /opt/local/lib specified when PHP was configured.

Why is it trying to load from /usr/lib when I specified in my configure not to?

httpd: Syntax error on line 115 of /private/etc/apache2/httpd.conf: Cannot load /usr/libexec/apache2/ into server: dlopen(/usr/libexec/apache2/, 10): Library not loaded: /opt/local/lib/libiconv.2.dylib\n Referenced from: /usr/libexec/apache2/\n Reason: Incompatible library version: requires version 8.0.0 or later, but libiconv.2.dylib provides version 7.0.0

The error message above refers to /opt/local/lib which when I run:

otool -LD /opt/local/lib/libiconv.2.dylib 


/opt/local/lib/libiconv.2.dylib: /opt/local/lib/libiconv.2.dylib (compatibility version 8.0.0, current version 8.0.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.0.0)

It shows that the version is different than what httpd is erring out as.

I have a feeling I need to recompile Apache using newer libraries, but the error message still doesn't make too much sense to me.

share|improve this question
How do you start the apache server? – Mark Jan 18 '11 at 16:54
/usr/sbin/apachectl -k [graceful|restart|stop...] Apache is running currently, but when I attempt to stop/start/restart (etc.) it the error above kicks out – Anthony Jan 18 '11 at 18:00
up vote 1 down vote accepted

As you have files in /opt/local I assume you are using MacPorts. In this case PHP will have been compiled against Apache in MacPorts (in /opt/local/bin), and you will need to configure and start that one, not the default Apple supplied one.

share|improve this answer
I've set my path to use use the PHP binary in /opt/local/bin which is fine. PHP cli is working well, but should I recompile apache as well? Sorry guys, by no means am I a server admin, just trying to learn a bit here. – Anthony Jan 18 '11 at 21:03
because you havecompiled php against the macports apache and not the one in /usr/sbin and they have different binary APIs – Mark Jan 19 '11 at 6:30

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.