php-在 apache2 上安装 ffmpeg
php-ffmpeg installation on apache2
正在尝试 运行 PHP-FFMPEG,在通过 composer 安装后,我目前得到了这个。
PHP Fatal error: Uncaught
Alchemy\BinaryDriver\Exception\ExecutableNotFoundException:
Executable not found, proposed : avprobe, ffprobe in
/var/www/html/vendor/alchemy/binary-driver/src/Alchemy/BinaryDriver/AbstractBinary.php:159\nStack
trace:\n#0
/var/www/html/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/Driver/FFProbeDriver.php(48):
Alchemy\BinaryDriver\AbstractBinary::load(Array, NULL,
Object(Alchemy\BinaryDriver\Configuration))\n#1
/var/www/html/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/FFProbe.php(226):
FFMpeg\Driver\FFProbeDriver::create(Object(Alchemy\BinaryDriver\Configuration),
NULL)\n#2
/var/www/html/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/FFMpeg.php(117):
FFMpeg\FFProbe::create(Array, NULL,
Object(Doctrine\Common\Cache\ArrayCache))\n#3
/var/www/html/starapp/test.php(4): FFMpeg\FFMpeg::create()\n#4
{main}\n\nNext FFMpeg\Exception\ExecutableNotFoundException: Unable
to load FFProbe in
/var/www/html/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/Driver/FFProbeDriver.php:50\nStack
trace:\n#0 /var/www/html/vendor/php-ffmpeg/php-ffmpeg/src/FFMp in
/var/www/html/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/Driver/FFProbeDriver.php
on line 50
有人建议运行宁以下:
$ffmpeg = FFMpeg\FFMpeg::create([
'ffmpeg.binaries' => 'usr/bin/ffmpeg',
'ffprobe.binaries' => 'usr/bin/ffprobe',
'timeout' => 3600, 'ffmpeg.threads' => 12
]);
但是我在 usr/bin 中没有 ffmpeg/ffprobe 个文件,而且似乎无法在任何地方找到它们。
编辑:
FFMpeg 已安装。我重新启动了服务器并重新启动了 apache2,现在文件可见了。立即获取:
PHP Fatal error: Uncaught
Alchemy\BinaryDriver\Exception\ExecutableNotFoundException:
Executable not found, proposed : usr/bin/ffprobe in
/var/www/html/vendor/alchemy/binary-driver/src/Alchemy/BinaryDriver/AbstractBinary.php:159\nStack
trace:\n#0
/var/www/html/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/Driver/FFProbeDriver.php(48):
Alchemy\BinaryDriver\AbstractBinary::load(Array, NULL,
Object(Alchemy\BinaryDriver\Configuration))\n#1
/var/www/html/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/FFProbe.php(226):
FFMpeg\Driver\FFProbeDriver::create(Object(Alchemy\BinaryDriver\Configuration),
NULL)\n#2
/var/www/html/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/FFMpeg.php(117):
FFMpeg\FFProbe::create(Array, NULL,
Object(Doctrine\Common\Cache\ArrayCache))\n#3
/var/www/html/starapp/test.php(11): FFMpeg\FFMpeg::create(Array,
NULL)\n#4 {main}\n\nNext
FFMpeg\Exception\ExecutableNotFoundException: Unable to load FFProbe
in
/var/www/html/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/Driver/FFProbeDriver.php:50\nStack
trace:\n#0 /var/www/html/vendor/php-ffmpeg/php-ffmp in
/var/www/html/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/Driver/FFProbeDriver.php
on line 50
问题是路径
'ffmpeg.binaries' => 'usr/bin/ffmpeg',
'ffprobe.binaries' => 'usr/bin/ffprobe'
鉴于:
'ffmpeg.binaries' => '/usr/bin/ffmpeg',
'ffprobe.binaries' => '/usr/bin/ffprobe'
正在工作。
正在尝试 运行 PHP-FFMPEG,在通过 composer 安装后,我目前得到了这个。
PHP Fatal error: Uncaught Alchemy\BinaryDriver\Exception\ExecutableNotFoundException: Executable not found, proposed : avprobe, ffprobe in /var/www/html/vendor/alchemy/binary-driver/src/Alchemy/BinaryDriver/AbstractBinary.php:159\nStack trace:\n#0 /var/www/html/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/Driver/FFProbeDriver.php(48): Alchemy\BinaryDriver\AbstractBinary::load(Array, NULL, Object(Alchemy\BinaryDriver\Configuration))\n#1 /var/www/html/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/FFProbe.php(226): FFMpeg\Driver\FFProbeDriver::create(Object(Alchemy\BinaryDriver\Configuration), NULL)\n#2 /var/www/html/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/FFMpeg.php(117): FFMpeg\FFProbe::create(Array, NULL, Object(Doctrine\Common\Cache\ArrayCache))\n#3 /var/www/html/starapp/test.php(4): FFMpeg\FFMpeg::create()\n#4 {main}\n\nNext FFMpeg\Exception\ExecutableNotFoundException: Unable to load FFProbe in /var/www/html/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/Driver/FFProbeDriver.php:50\nStack trace:\n#0 /var/www/html/vendor/php-ffmpeg/php-ffmpeg/src/FFMp in /var/www/html/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/Driver/FFProbeDriver.php on line 50
有人建议运行宁以下:
$ffmpeg = FFMpeg\FFMpeg::create([
'ffmpeg.binaries' => 'usr/bin/ffmpeg',
'ffprobe.binaries' => 'usr/bin/ffprobe',
'timeout' => 3600, 'ffmpeg.threads' => 12
]);
但是我在 usr/bin 中没有 ffmpeg/ffprobe 个文件,而且似乎无法在任何地方找到它们。
编辑:
FFMpeg 已安装。我重新启动了服务器并重新启动了 apache2,现在文件可见了。立即获取:
PHP Fatal error: Uncaught Alchemy\BinaryDriver\Exception\ExecutableNotFoundException: Executable not found, proposed : usr/bin/ffprobe in /var/www/html/vendor/alchemy/binary-driver/src/Alchemy/BinaryDriver/AbstractBinary.php:159\nStack trace:\n#0 /var/www/html/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/Driver/FFProbeDriver.php(48): Alchemy\BinaryDriver\AbstractBinary::load(Array, NULL, Object(Alchemy\BinaryDriver\Configuration))\n#1 /var/www/html/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/FFProbe.php(226): FFMpeg\Driver\FFProbeDriver::create(Object(Alchemy\BinaryDriver\Configuration), NULL)\n#2 /var/www/html/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/FFMpeg.php(117): FFMpeg\FFProbe::create(Array, NULL, Object(Doctrine\Common\Cache\ArrayCache))\n#3 /var/www/html/starapp/test.php(11): FFMpeg\FFMpeg::create(Array, NULL)\n#4 {main}\n\nNext FFMpeg\Exception\ExecutableNotFoundException: Unable to load FFProbe in /var/www/html/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/Driver/FFProbeDriver.php:50\nStack trace:\n#0 /var/www/html/vendor/php-ffmpeg/php-ffmp in /var/www/html/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/Driver/FFProbeDriver.php on line 50
问题是路径
'ffmpeg.binaries' => 'usr/bin/ffmpeg',
'ffprobe.binaries' => 'usr/bin/ffprobe'
鉴于:
'ffmpeg.binaries' => '/usr/bin/ffmpeg',
'ffprobe.binaries' => '/usr/bin/ffprobe'
正在工作。