這是主要的index.php文件,我運行我的代碼生成與ffmpeg的視頻縮略圖,但它根本沒有lucks我一直在網上搜索了很多的解決方案,但沒有出現,如果你們能幫助我,我將非常感激。該了shell_exec()不斷給我錯誤php shell_exec()命令彈出錯誤和權限被拒絕ffmpeg
<html>
<head>
</head>
<body>
<form action="index.php" method="POST" enctype="multipart/form-data">
<input type="file" name="file"><input type="submit" name="submit" value="upload">
</form>
<?php
if(isset($_POST['submit'])){
$ffmpeg = "/Users/mac/Documents/ffmpeg/3.1.4/bin/ffmpeg";
$videoFile = $_FILES["file"]["tmp_name"];
$imageFile = "1.jpg";
$size = "320x240";
$getFromSecond = 5;
$cmd = "$ffmpeg -i $videoFile -an -ss $getFromSecond -s $size $imageFile 2>&1";
echo shell_exec($cmd);
echo shell_exec('whoami');
if(!shell_exec($cmd)){
echo "thumbnail created";
}else{
echo "error creating thumbnail";
}
}
?>
</body>
</html>
是不是很明顯,它說**權限被拒絕**? –
是的,它一直說權限被拒絕,我不知道最新錯誤我跟着abell.com教程,最終出現錯誤,但視頻教程的工作https://www.youtube.com/watch?v=qT4hN5o57hI&index=3&list=PLf1QYWO6pRZiBa_7JlpR -ejHaIHzFblMq – user3711175
當我將其更改爲exec()後,它沒有提示出任何錯誤,但沒有在我的文件夾中創建圖像 – user3711175