On Wed, Feb 07, 2007 at 08:44:36PM -0500, James McManus wrote:
> Hi - How do I set library path for httpd server on fedora core 6? I am
> trying to run a program (mapserv) through cgi-bin. I am getting the
> following error message:
>
> error while loading shared libraries: libpq.so.5
>
> This file is located in /usr/local/pgsql/lib
>
> To run mapserv from shell, I set LD_LIBRARY_PATH, in my .bashrc file
> (bad habit). How do I make similar setting so that it will run under
> cgi-bin?
A couple options:
1. Add the directory to /etc/ld.so.conf and update the cache by
running ldconfig.
2. Create a wrapper that calls the actual binary. Put the
LD_LIBRARY_PATH in the wrapper. For example:
#!/bin/sh
LD_LIBRARY_PATH=/usr/local/pgsql/lib exec /path/to/actual/cgi/binary
3. Link the program with /usr/local/pgsql/lib in the runtime
library search path. See the ld(1) man page for the -rpath option.
Also, see the gcc(1) man page for passing arguments to ld
(specifically, the -Wl option):
gcc -Wl,-rpath,/usr/local/pgsql/lib ... etc ...
Maybe others I'm not thinking of?
--
Steve Feehan
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: [EMAIL PROTECTED]
" from the digest: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]