PHP exec不执行命令 [英] PHP exec not executing command

查看:69
本文介绍了PHP exec不执行命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经使用php的exec执行FFmpeg命令,但是当我在浏览器中将其打开时,它无法启动.但是当我在终端中运行此php文件脚本时,它工作正常.而且我的php安全模式已关闭.请帮助我解决它.我的php代码是

I have used php's exec to execute FFmpeg command but its not woking when I open it in browser. But when i run this php file script in terminal it works fine.And my php safe mode is off. please help me to get it solved. my php code is

<?php
$output=exec("ffmpeg -f image2 -i /home/phedra/imgs/image/img%03d.png -r 12 -s 610x489 /home/phedra/imgs/video/out.avi", $out);
echo $out;
echo $output;
?>

推荐答案

尝试给出ffmpeg应用程序所在位置的完整路径.

try giving full path where the ffmpeg application is located.

例如

/usr/bin/ffmpeg

所以您的函数可能类似于:

So your function might look like:

$output=exec("/usr/bin/ffmpeg -f image2 -i /home/phedra/imgs/image/img%03d.png -r 12 -s 610x489 /home/phedra/imgs/video/out.avi", $out);

您必须检查"ffmpeg"的位置.

You must check what is the location of "ffmpeg".

这篇关于PHP exec不执行命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆