在ubuntu版本14中设置权限(PHP5)shell_exec(“wine ffmpeg.exe”)

在ubuntu版本14中设置权限(PHP5)shell_exec(“wine ffmpeg.exe”),php,ubuntu,ffmpeg,shell-exec,wine,Php,Ubuntu,Ffmpeg,Shell Exec,Wine,如何在phpshell_exec(“wine ffmpeg.exe”)中启动wine (ubuntu版本14服务器) 安装 sudo apt-get install wine -y php5代码: $cmd = "/usr/bin/wine /var/www/html/ffmpeg.exe upload/image.jpg" shell_exec($cmd); ffmpeg.exe位置: /var/www/html/ 葡萄酒没有开始? Linux版本的FFmpeg?,如何运行PHPshell

如何在php
shell_exec(“wine ffmpeg.exe”)中启动wine

(ubuntu版本14服务器)

安装

sudo apt-get install wine -y
php5代码:

$cmd = "/usr/bin/wine /var/www/html/ffmpeg.exe upload/image.jpg"
shell_exec($cmd);
ffmpeg.exe
位置: /var/www/html/

葡萄酒没有开始?

Linux版本的FFmpeg?,如何运行PHP
shell\u exec()

服务器域不在共享主机上

www-data
上的权限可能有问题

命令ffmpeg在终端中成功

有一个权限问题,刚刚测试过,命令正确。
ffmpeg.exe或wine的权限不正确

命令(ffmpeg.exe)

命令(/usr/bin/wine)


sudo服务apache2重启

仍然不起作用,可能有更多的“wine”文件需要应用权限。
我无法输出任何错误,并且从终端发送到ffmpeg的命令是正确的问题必须是权限问题首先,为您的服务器下载并安装ffmpeg:,是的,有Linux版本

然后,最好使用exec()并在后台运行ffmpeg,这样就不必等到视频转换到另一个页面

$cmd = 'ffmpeg -- parameters here --';
// 2>&1 is used for execute on background
exec("$cmd 2>&1", $output);
// Do you need to debug?
// See ffmpeg results:
var_dump($output);

这到底怎么会有五张赞成票和两个最受欢迎的明星?你“假设”它没有正确启动?你为什么要假设什么?在尝试运行命令时,是否查看了STDOUT、STDERR或返回值?是的,当然有一个Linux版本的ffmpeg。基本的网络搜索会告诉你这一点。通过PHP运行它不需要做什么特殊的事情。在这里提问之前,请先进行基础研究,并阅读关于提出有效问题的提示$proc=popen($cmd,'r');echo$proc;=(输出)资源id#20shell_exec($cmd,$OUTPUT);变量转储(输出);(输出)=null此处的安装没有问题,从终端执行时工作。必须是文件权限,因为ffmpeg和shell_exec在运行时没有错误。如果PHP配置为CGI?,可能您需要运行PHP cli以使其正常工作,请检查以下内容:@user235423424,如果不需要,应避免使用Wine。在这里完全没有必要。只需使用ffmpeg的本机版本。这几乎肯定会更快,使用更少的内存,产生更少的错误。请尝试将完整路径添加到ffmpeg二进制文件中。例如
/usr/bin/ffmpeg
。您可以使用以下命令定位路径:
which ffmeg
chmod 755 wine
chown www-data wine
$cmd = 'ffmpeg -- parameters here --';
// 2>&1 is used for execute on background
exec("$cmd 2>&1", $output);
// Do you need to debug?
// See ffmpeg results:
var_dump($output);