I am using CentOS 5.6 and I have problems executing programs from PHP. When I run the same command from bash as root, it works fine.
PHP script I am executing:
echo (shell_exec("/opt/bin/mediainfo --Inform=file:///var/www/html/test/media_general.txt /var/www/html/test/video/2046.flv"));
When I run this script, it does not produce any input, in error log, it shows
/opt/bin/mediainfo: error while loading shared libraries: libmediainfo.so.0: cannot open shared object file: No such file or directory
When I run command
/opt/bin/mediainfo --Inform=file:///var/www/html/test/media_general.txt /var/www/html/test/video/2046.flv
in bash as root, it works fine, gives the output it should give.
I am new to Linux, but is it because Apache does not have enough rights? The file /opt/bin/mediainfo has 0777 permissions, owner root, group root. I execute from PHP more similar programs, some run fine, but some give an error, usually they cannot load some libraries. Can it be fixed somehow?
Thanks in advance for any help.