Is it possible to control which libraries apache uses?

久未见 提交于 2019-12-02 04:44:06

There is a way, but since it is a different version of the jpeg library, you are likely going to break whatever it is that is getting to load the old library first.

The problem likely is that you are loading PHP into the same Apache installation and it is preloading a PHP extension module which has a dependency on the older version of the jpeg library. Because PHP is taking precedence over what Python gets to do, you are stuck with that wrong library.

So, try disabling mod_php so it isn't loaded into Apache. If your problem goes away you know it is that. If it does work and you don't need PHP then leave it permanently disabled. If you do need PHP, then change to using PHP under fastcgi instead, that way you avoid PHP being loaded into Apache processes themselves. Alternatively, you will need to update/rebuild PHP to use the same jpeg version.

Now for the hack to preload the different version of jpeg library, but that likely will not work or cause later problems. This hack is to change the init scripts for Apache such that it sets:

LD_PRELOAD=/some/path/libjpeg.so.8.0.0
export LD_PRELOAD

This tells operating system to preload that library into process address space before it does anything.

BTW, if it is PHP, the reason you aren't finding it with ldd is that the PHP extension modules are installed in a different directory to where the Apache module is.

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