在ubuntu版本14中设置权限(PHP5)shell_exec(“wine ffmpeg.exe”) [英] set permissions (PHP5) shell_exec("wine ffmpeg.exe") in ubuntu version 14
问题描述
如何在php shell_exec(wine ffmpeg.exe)中启动葡萄酒; ?
How to start wine in php shell_exec("wine ffmpeg.exe"); ?
(ubuntu 14版服务器)
(ubuntu version 14 server)
安装
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 /
ffmpeg.exe location: /var/www/html/
葡萄酒不开始?
Linux版本的FFmpeg?,如何运行PHP shell_exec()?
wine is not starting?
Linux version of FFmpeg?, how to run PHP shell_exec()?
服务器域不在共享主机上
Server domain is not on shared hosting
www-data
可能是问题?
命令ffmpeg在终端中的成功
command ffmpeg successfull in terminal!
有一个权限问题,只是测试和命令是正确的。
或者ffmpeg.exe或葡萄酒具有不正确的权限。
there is a permission issue, just tested and command is correct.
either ffmpeg.exe or wine have incorrect permissions.
命令(ffmpeg.exe)
Command (ffmpeg.exe)
chmod 755 ffmpeg.exe
chown www-data ffmpeg.exe
命令(/ usr / bin / wine)
Command (/usr/bin/wine)
chmod 755 wine
chown www-data wine
sudo service apache2 restart
仍然无法使用,可以将更多的wine文件应用到。
我不能输出任何错误,命令ffmpeg从终端是正确的问题必须是权限
still not working, could be more 'wine' files to apply permissions to. I'm not able to output any error, and command to ffmpeg is correct from terminal the problem must be permissions
推荐答案
p>首先,为您的服务器下载并安装FFmpeg: https://www.ffmpeg .org / download.html ,是的,有Linux的版本。
First of all, download and install FFmpeg for your server: https://www.ffmpeg.org/download.html, yes, there are versions for Linux.
然后,最好使用exec()并运行ffmpeg在背景上,所以您不必等待视频转换为另一页。
Then, it's better to use exec() and run ffmpeg on background, so you don't have to wait until the video is converted to go to another page.
$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);
这篇关于在ubuntu版本14中设置权限(PHP5)shell_exec(“wine ffmpeg.exe”)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!