Is there a way to get PHP to define LD_LIBRARY_PATH when using
exec to start an external program?
I wrote an xml validation utility in C++ that links to the Xerces C library.
I linked with the -rpath option, so that I should not have to
manually set the LD_LIBRARY_PATH to find the Xerces shared object.
This works fine from the command line. I can run my tool and it finds
the library without having LD_LIBRARY_PATH set.
(If -rpath is not used when linking an ELF executable,
the contents of the environment variable "LD_RUN_PATH"
will be used if it is defined.)
But when I try to run the tool through PHP using exec()
I get this error:
xml_validate: error while loading shared libraries:
libxerces-c.so.25: cannot open shared object file:
No such file or directory
This is the error I would get from the command line if I
didn't use the -rpath linker option and had not set LD_LIBRARY_PATH.
Does PHP do something that bypasses the run time linker options?
If so then I assume this is for safety, but checking my safe_mode options
I find this:
safe_mode: Off
safe_mode_exec_dir: no value
safe_mode_gid: Off
safe_mode_include_dir: no value
Is there a way to get PHP to define LD_LIBRARY_PATH when using
exec to start an external program?
I'm using PHP 4.3.5.
Any help or advice is appreciated.
Yours,
Noah