Ubuntu-Laravel 5.6-无法加载ffprobe(使用php-ffmpeg) [英] Ubuntu - Laravel 5.6 - Unable to load ffprobe (using php-ffmpeg)
问题描述
我在ubuntu系统上安装了ffmpeg和ffprobe(可以通过命令行访问)
I have ffmpeg and ffprobe installed on my ubuntu system (can access it via command line)
ffmpeg和ffprobe位于/usr/bin/
ffmpeg and ffprobe are located in /usr/bin/
我通过作曲家安装了这些
I installed these via composer
"php-ffmpeg/binary-driver": "dev-master",
"php-ffmpeg/php-ffmpeg": "^0.11.1",
我已经完成: 使用FFMpeg;
I've done: use FFMpeg;
// in index() function//
$ffmpeg = FFMpeg\FFMpeg::create([
'ffmpeg.binaries' => '/usr/bin/ffmpeg',
'ffprobe.binaries' => '/usr/bin/ffprobe'
]);
并仍然获得
FFMpeg \异常\ ExecutableNotFoundException
FFMpeg \ Exception \ ExecutableNotFoundException
无法加载FFProbe
Unable to load FFProbe
为此,我查看了大约30个论坛,但没有运气,有些指导会有所帮助
I have looked at about 30 forums for this and no luck, some direction would be helpful
更新
我尝试了chmod +x /usr/bin/ffprobe
然后重新启动,什么也不做.
Then restarted, did nothing.
然后我尝试了:
sudo chgrp www-data /usr/bin/ffprobe
sudo chmod g+x /usr/bin/ffprobe
sudo chgrp www-data /usr/bin/ffprobe
sudo chmod g+x /usr/bin/ffprobe
然后重新启动,什么也不做.
Then restarted, did nothing.
更新 我忘了提到我在docker中运行php-fpm + nginx.我为php-ffmpeg添加了pbmedia包装器,如果我在没有docker的情况下运行laravel项目(php artisan服务),它就可以正常工作.
UPDATE I forgot to mention that I am running php-fpm + nginx in docker.I added pbmedia wrapper for php-ffmpeg and If I run the laravel project without docker (php artisan serve) it works fine.
现在的问题是,我需要从Docker内部引用/usr/bin/ffprobe目录
The issue now is that I need to reference the /usr/bin/ffprobe directory from within docker
推荐答案
您提到的
ffmpeg和ffprobe位于/usr/bin/
ffmpeg and ffprobe are located in /usr/bin/
,但稍后在/usr/local/bin/
$ffmpeg = FFMpeg\FFMpeg::create([
'ffmpeg.binaries' => '/usr/local/bin/ffmpeg',
'ffprobe.binaries' => '/usr/local/bin/ffprobe'
]);
那是要检查的一件事.
另一个是确保二进制文件为php以..运行的正确用户设置了可执行位,在ubuntu下,该用户可能是www-data
(如果不确定您的php脚本发出的输出是whoami
或id -un
等).
The other is to ensure that the binaries have the executable bit set for the right user that php runs as .. under ubuntu this user may be the www-data
(if you're unsure have your php script emit the output of whoami
or id -un
, etc).
sudo chgrp www-data /usr/bin/ffprobe
sudo chmod g+x /usr/bin/ffprobe
这篇关于Ubuntu-Laravel 5.6-无法加载ffprobe(使用php-ffmpeg)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!