How does Mac OSX determine which dylib to load?

烂漫一生 提交于 2019-12-05 16:19:30

This happens when the environment contains DYLD_LIBRARY_PATH=/usr/lib. Unset that and it should work.

Libraries are referenced using absolute paths on OS X. You correctly noticed /opt/local/apache2/modules/mod_php53.so references /opt/local/lib/libaprutil-1.0.dylib using its absolute path. However, in the presence of DYLD_LIBRARY_PATH the loader ignores the directory components and searches for the filename in the directories specified in DYLD_LIBRARY_PATH.

The error message you see is misleading: It is trying to tell you that an error occurred in the code that attempted to handle the /opt/local/lib/libaprutil-1.0.dylib load command (which was diverted due to the env variable).

Also, note that since MacPorts builds its PHP against MacPorts Apache, your PHP module is not necessarily binary-compatible to the system Apache. It might work for you, but that's only a coincidence.

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