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/li开发者_如何学运维b/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
It looks like you've got some dependency version issues. I'm guessing you copied the libraries from some other server which was using a different version of the core system files than this one does.
Your best bet is to build from source on the machine you're using it from. That will ensure that your libraries aren't linking to something that isn't present on your system.
EDIT
And actually, the reference to /opt/lampp makes me think that you're not using the standard webserver install that you normally would on an Ubuntu server, but are instead using lampp. That could be the source of your conflict -- if the lampp stuff is linked differently than the "normal" system libraries, then you might not be able to use them together.
The user your web server is running under does not have the same environment as your terminal user. You will need to add /opt/lampp/lib to the web server user's environment. Look for /opt/lampp/lib in /etc/ld.so.conf and the files in /etc/ld.so.conf.d. If it's not there, make a new file in /etc/ld.so.conf.d with a line containing just that path. You will need to restart the web server.
Looking at this post: http://fedoraforum.org/forum/showpost.php?p=1375187&postcount=2
I feel your problem could be solved, try installing PHP from APT-GET instead of LAMPP and see does it solve your problem.
You can get PHP,APACHE & MySQL by:
sudo apt-get install apache2, libapache2-mod-php5, php5, mysql-client, mysql-common, mysql-server
- http://rakeshsankar.wordpress.com/2010/09/10/install-setup-debian-server/
精彩评论