简体   繁体   English

php exec() 错误...有人知道这是什么意思吗?

[英]php exec() error…Anyone know what this means?

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. 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我正在使用“php”命令通过终端使用。

When I try to execute the file using a browser, however, I get the following error in my apache error log.但是,当我尝试使用浏览器执行该文件时,我的 apache 错误日志中出现以下错误。 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) /usr/local/bin/ffmpeg:/opt/lampp/lib/libgcc_s.so.1:找不到版本“GCC_4.2.0”(/usr/lib/i386-linux-gnu/libstdc++.so.6 需要)

PHP code PHP代码

define('FFMPEG_LIBRARY', '/usr/local/bin/ffmpeg');定义('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'); $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/ 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我进入 /usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5.2

and copied the libgcc_s.so into并将 libgcc_s.so 复制到

/opt/lampp/lib and renamed it to libgcc_s.so.1 to overwrite the previous file /opt/lampp/lib 并将其重命名为 libgcc_s.so.1 以覆盖之前的文件

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.实际上,对 /opt/lampp 的引用让我认为您没有使用通常在 Ubuntu 服务器上安装的标准网络服务器,而是使用 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.这可能是您冲突的根源——如果lampp 的东西与“正常”系统库的链接方式不同,那么您可能无法将它们一起使用。

The user your web server is running under does not have the same environment as your terminal user. web 服务器运行的用户与终端用户的环境不同。 You will need to add /opt/lampp/lib to the web server user's environment.您需要将 /opt/lampp/lib 添加到 web 服务器用户环境。 Look for /opt/lampp/lib in /etc/ld.so.conf and the files in /etc/ld.so.conf.d.在 /etc/ld.so.conf 中查找 /opt/lampp/lib 和 /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.如果它不存在,请在 /etc/ld.so.conf.d 中创建一个新文件,其中包含仅包含该路径的行。 You will need to restart the web server.您将需要重新启动 web 服务器。

Looking at this post: http://fedoraforum.org/forum/showpost.php?p=1375187&postcount=2看这个帖子: 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.我觉得您的问题可以解决,尝试从 APT-GET 而不是 LAMPP 安装 PHP,看看它是否解决了您的问题。

You can get PHP,APACHE & MySQL by:您可以通过以下方式获得 PHP,APACHE 和 MySQL:

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/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM