The shared library is built by the 'make' of Python. The 'ldconfig'
program is a system maintenance program generally only needed if you
want to add additional directories outside the normal library
directory search path such that programs can find them without having
to set LD_LIBRARY_PATH environment variable or having the directories
coded into program using LD_RUN_PATH environment variable at compile
time. If the Python library was installed in /usr/local/lib and that
was in the standard search path, 'ldconfig' shouldn't generally have
been required.
Graham
That isn't your fault, the Python install target doesn't necessarily
create it. What it might do is put the .so in /usr/local/lib directory
only. What it should also do is create a symlink in the config
directory to it, but I don't think it does, it certainly doesn't in
older versions of Python.
This means that Linux distributions which provide Python often have to
add this symlink themselves. In other words, I believe it is a flaw of
the Python source code distribution. I don't know if it has been
addressed in more recent versions of Python source code.
Thus run:
cd /usr/local/lib/python2.5/config
ln -s ../../libpython2.5.so .
You need to create this symlink before you build mod_wsgi else
mod_wsgi will still use the static library. When the static library is
used it will sometimes work, but other times it causes problems.
> The only thing I can think of is that I was unable to make Python with
> --enable-shared at first
> and then I ran make correctly to create the .so file in /usr/local/
> lib/.
>
> FYI my version of Python was compiled for 64 bit(I compiled it on
> AMD64) before I started trying to compile mod_wsgi. But I doubt --
> enable-shared was given to ./configure.
If you run:
ldd mod_wsgi.so
on the resultant Apache mod_wsgi module, what does it output? You
should see a dependency on libpython2.5.so and it should pick it up
from /usr/local/lib.
> PS: I found this at the bottom of the man page for ldconfig:
>
> BUGS
> ldconfig, being a user process, must be run manually and has
> no means of dynamically determining and relinking shared libraries for
> use by ld.so when a new shared library is installed.
>
> Is it possible that after Python's make built the shared library I
> needed to manually run ldconfig to tell ld where to find my newly
> created and installed shared object file?
It may be possible, but generally that may mean having to edit its
config file in /etc to add /usr/local/lib if it isn't already listed,
or possibly listing /usr/local/lib as an argument to ldconfig.
Anyway, run ldd on mod_wsgi.so and we'll work out whether it is using
the shared library or not. Also send a listing of files in the config
directory. Ie.,
cd /usr/local/lib/python2.5/config
ls -las
Graham
so
Thanks.
Graham