这是主要的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