[NCLUG] Apache clobbering LD_LIBRARY_PATH

Michael Dwyer mdwyer at sixthdimension.com
Tue Apr 16 13:06:33 MDT 2002


Matt Clauson wrote:
> Running Apache, Redhat 6.2ee, without suexec...  I have a compiled C CGI
> that calls a shell script.  The script sources another script, which sets
> LD_LIBRARY_PATH in the environment...  However, when it tries to execute
> another program two lines later, LD_LIBRARY_PATH appears to be magically
> unset...  Any ideas?

This script that sets the LD_LIBRARY_PATH -- does it use 'export'?  If
you don't export the environment variable, then the parent wouldn't get
set (if I understand correctly).  This would probably cause what you are
seeing...

Change:
  LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/path/to/libs 
To:
  export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/path/to/libs



More information about the NCLUG mailing list