0

When i run ffmpeg on cmd it works good, i put export LD_LIBRARY_PATH=/usr/local/lib into /etc/profile.d because it couldn't fine libmp3lame at the first

enter image description here

But when i run it with PHP exec() it still gives /usr/local/bin/ffmpeg: error while loading shared libraries: libmp3lame.so.0: cannot open shared object file: No such file or directory

$exec_string = '/usr/local/bin/ffmpeg -version 2>&1';
echo exec($exec_string);

Why it works on cmd but not on php exec() ?

0

Figured. Here is the solution

putenv("LD_LIBRARY_PATH=/usr/local/lib");

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.