I'm stuck on a case where the MySQL libraries won't be found on a Apache/mod_wsgi/Django deployed server, altough Python alone can import the library correctly.
Here's my Apache log errors:
[Tue Jul 10 12:52:02 2012] [error] [client 127.0.0.1] File "/remote/projects1/pdrtke/python/lib/python2.6/site-packages/Django-1.3-py2.6.egg/django/utils/importlib.py", line 35, in import_module
[Tue Jul 10 12:52:02 2012] [error] [client 127.0.0.1] __import__(name)
[Tue Jul 10 12:52:02 2012] [error] [client 127.0.0.1] File "/remote/projects1/pdrtke/python/lib/python2.6/site-packages/Django-1.3-py2.6.egg/django/db/backends/mysql/base.py", line 14, in <module>
[Tue Jul 10 12:52:02 2012] [error] [client 127.0.0.1] raise ImproperlyConfigured("Error loading MySQLdb module: %s" % e)
[Tue Jul 10 12:52:02 2012] [error] [client 127.0.0.1] ImproperlyConfigured: Error loading MySQLdb module: libmysqlclient_r.so.16: cannot open shared object file: No such file or directory
I already tried the following:
- Check that Python interpreter can do
import MySQLdb
: Ok - Check that
python manage.py ...
actions requiring database support work: Ok - Check that
LD_LIBRARY_PATH
points to a directory where libmysqlclient_r.so.16 is available : Ok - Attach the
httpd
process withgdb
, and do ashow env
: TheLD_LIBRARY_PATH
points tolibmysqlclient_r.so.16
too - Modify the
envvars
file in the bin/http directory to add anexport LD_LIBRARY_PATH=...
(just in case): Ok - Check by a
ldd libmysqlclient_r.so.16
that the library itself does not contain unresolved dependencies - Check that the
httpd
executable does not have the setuid bit set; which is a documented reason to ignore theLD_LIBRARY_PATH
: Ok
None of these actions seem to solve my problem. Is there an obvious thing I forgot to consider?