[英]set permissions (PHP5) shell_exec(“wine ffmpeg.exe”) in ubuntu version 14
如何在php shell_exec("wine ffmpeg.exe");
啟動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 /
酒不開始嗎?
Linux版本的FFmpeg ?,如何運行PHPshell_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);
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.