php - 在 ubuntu 版本 14 中设置权限 (PHP5) shell_exec ("wine ffmpeg.exe")

标签 php ubuntu ffmpeg shell-exec wine

如何在php中启动wine shell_exec("wine ffmpeg.exe"); ?

(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/

wine is not starting?

Linux version of FFmpeg?, how to run PHP shell_exec()?



服务器域不在共享主机上

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

在终端中成功命令ffmpeg!

存在权限问题,刚刚测试过,命令是正确的。
ffmpeg.exe 或 wine 的权限不正确。

命令 (ffmpeg.exe)
chmod 755 ffmpeg.exe
chown www-data ffmpeg.exe

命令(/usr/bin/wine)
chmod 755 wine
chown www-data wine
sudo service apache2 restart
仍然无法正常工作,可能需要更多“葡萄酒”文件来应用权限。
我无法输出任何错误,从终端到 ffmpeg 的命令是正确的,问题必须是权限

最佳答案

首先,为您的服务器下载并安装 FFmpeg: https://www.ffmpeg.org/download.html ,是的,有适用于 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);

关于php - 在 ubuntu 版本 14 中设置权限 (PHP5) shell_exec ("wine ffmpeg.exe"),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45383770/

相关文章:

reactjs - npm 安装 : Ecacess: permission denied

java - 在 Ubuntu 上安装 Grakn

git - 通过 wsl (ubuntu) 和 windows 终端使用 git,如何将默认分支名称更改为 main?

php - 上传后转换视频

php - 如何将属性添加到 PHP SoapVar 对象?

javascript - 限制对特定页面的访问

php - 是否可以使用下载属性强制下载?

php - 为什么错误消息没有显示?

video - 添加帧计数叠加,而不更改编解码器属性

django - 处理子进程文件输出