I
I
Ilia Malashko2022-02-16 10:55:22
PHP
Ilia Malashko, 2022-02-16 10:55:22

How to debug php-ffmpeg library error?

Hello.

It is necessary to shoot posters from video files.
I decided to use the library https://github.com/PHP-FFMpeg/PHP-FFMpeg/tree/0.x

Installed ffmpeg on the server.
Installed PHP-FFMpeg via composer.
When trying to execute the code from "Basic Usage" it gives an error:

Warning: file_exists(): open_basedir restriction in effect. File(/usr/bin/ffprobe) is not within the allowed path(s): (/var/www/vamsvet/data:.) in /var/www/vamsvet/data/www/malashko.vamsvet.ru/vendor/alchemy/binary-driver/src/Alchemy/BinaryDriver/AbstractBinary.php on line 149

Fatal error: Uncaught Alchemy\BinaryDriver\Exception\ExecutableNotFoundException: Executable not found, proposed : avprobe, ffprobe in /{ROOT}/vendor/alchemy/binary-driver/src/Alchemy/BinaryDriver/AbstractBinary.php:159 Stack trace: #0 /{ROOT}/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/Driver/FFProbeDriver.php(48): Alchemy\BinaryDriver\AbstractBinary::load(Array, NULL, Object(Alchemy\BinaryDriver\Configuration)) #1 /{ROOT}/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/FFProbe.php(226): FFMpeg\Driver\FFProbeDriver::create(Object(Alchemy\BinaryDriver\Configuration), NULL) #2 /{ROOT}/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/FFMpeg.php(132): FFMpeg\FFProbe::create(Array, NULL, Object(Symfony\Component\Cache\Adapter\ArrayAdapter)) #3 /{ROOT}/malashko/index.php(5): FFMpeg\FFMpeg::create() #4 {main} Next FFMpeg\Exception\ExecutableNotFoundException: U in /{ROOT}/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/Driver/FFProbeDriver.php on line 50


Googled what should help if you pass the paths to the binaries to the create method
$ffmpeg = FFMpeg\FFMpeg::create([
    'ffmpeg.binaries' => "/usr/bin/ffmpeg",
    'ffprobe.binaries' => '/usr/bin/ffprobe',
    'timeout'          => 3600, 
    'ffmpeg.threads'   => 12,  
]);

but didn't help. (

What could be causing the problem?
How can I debug the error?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question