我在用php执行一段JAVA代码时,发现执行不了。
I have just installed ffmpeg on ubuntu using this guide http://ubuntuforums.org/showthread.php?t=786095, when I execute the ffmpeg command shown below, it works fine in terminal and it works when I execute the php file I am using through the terminal by using the 'php' command.
When I try to execute the file using a browser, however, I get the following error in my apache error log. If anyone could give me guidance, I would really appreciate it.
ERROR
/usr/local/bin/ffmpeg: /opt/lampp/lib/libgcc_s.so.1: version `GCC_4.2.0' not found (required by /usr/lib/i386-linux-gnu/libstdc++.so.6)
PHP code
define('FFMPEG_LIBRARY', '/usr/local/bin/ffmpeg');
$command = shell_exec('/usr/local/bin/ffmpeg -i /home/geoff/Desktop/cave.wmv -acodec libfaac -aq 100 -vcodec libx264 -preset slow -crf 22 -threads 0 /home/geoff/Desktop/newvideo.flv');
答案
This worked for me.
http://blog.codyjung.com/2011/05/29/problems-with-lampp-and-exec/
I went into /usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5.2
and copied the libgcc_s.so into
/opt/lampp/lib and renamed it to libgcc_s.so.1 to overwrite the previous file
原文:http://stackoverflow.com/questions/6255582/php-exec-error-anyone-know-what-this-means