Results 1 to 5 of 5
I am using an opensource utility wav2png. When I execute it through shell by any user it works fine. I uses a library libsndfile, which is placed at /usr/local/lib. I ...
- 11-21-2011 #1Just Joined!
- Join Date
- Nov 2011
- Posts
- 1
environment variable for daemon
I am using an opensource utility wav2png. When I execute it through shell by any user it works fine. I uses a library libsndfile, which is placed at /usr/local/lib. I added this path to PATH env variable. I added this path to PATH variable and export command for update PATH in /etc/profile.
But when I call wav2png command using system() in php, it says cannot found shared library libsndfile. and when printed the PATH through system command /usr/local/lib is not there..
I tried to add my library path through putenv method of php, but no luck.. If anybody can help me, I will be very thankful
- 11-22-2011 #2Just Joined!
- Join Date
- Jun 2004
- Location
- Halesowen, West Midlands, UK
- Posts
- 71
This is an ancient script I have lying around which should give you an idea
-------------------------------------------------------
#!/bin/sh
LD_PRELOAD=/libdl.so.2:/libc.so.6
export LD_PRELOAD
/opt/MultiLink/bin/Viewer&
-------------------------------------------------------
An alternative method would be to have a script with export
#!/bin/sh
export LD_LIBRARY_PATH=/usr/local/lib
wav2png
Hope that helps.
- 11-22-2011 #3Linux Guru
- Join Date
- May 2011
- Posts
- 1,838
Siddly's got it. Another thing you can do is put the lib's directory in a file on a single line in the directory /etc/ld.so.conf.d/ and give the file a .conf file extension.
So, for example, you could create a file called /etc/ld.so.conf.d/local.conf and in it put:
Then run a command to update the shared library cache on the system:Code:/usr/local/lib
Now look for your library in the cache:Code:ldconfig
If you see it, then you should be able call wav2png from the command line without having to worry about the location of the library.Code:ldconfig -p|grep wav2png
Btw, this is what works for me on Fedora/RH based systems. ymmv.
- 11-22-2011 #4Just Joined!
- Join Date
- Jun 2004
- Location
- Halesowen, West Midlands, UK
- Posts
- 71
- 11-22-2011 #5Linux Guru
- Join Date
- May 2011
- Posts
- 1,838


Reply With Quote
