Artem Konyaev
Artem Konyaev

Reputation: 1

FFMpeg PHP: Unable to load FFProbe

I am using the Lumen PHP framework which is the form of Laravel. On the server side I have Bitnami.

I get the 500 error when the code that uses FFMpeg is being executed. My part of the code which leads to the problem:

$ffmpeg = FFMpeg::create([
            'ffmpeg.binaries'   => '/opt/bitnami/apache/htdocs/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg',
            'ffprobe.binaries'  => '/opt/bitnami/apache/htdocs/vendor/php-ffmpeg/php-ffmpeg/src/FFProbe',
            'timeout' => 0
]);

I also tried it without 'timeout'.

Here are the details of the error that I get in the server response:

[ExecutableNotFoundException](#trace-box-2) [ExecutableNotFoundException](#trace-box-1)

HTTP 500 Internal Server Error

Unable to load FFProbe

Exceptions 2

FFMpeg\Exception\ExecutableNotFoundException

in /opt/bitnami/apache/htdocs/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/Driver/FFProbeDriver.php (line 50)

  1.         $binaries = $configuration->get('ffprobe.binaries', ['avprobe', 'ffprobe']);

  2.         

  3.         try {

  4.             return static::load($binaries, $logger, $configuration);

  5.         } catch (BinaryDriverExecutableNotFound $e) {

  6.             throw new ExecutableNotFoundException('Unable to load FFProbe', $e->getCode(), $e);

  7.         }

  8.     }

  9. }

I tried changing the project folder rights by sudo chmod -R 777 /opt/bitnami/apache/htdocs. Not sure if it worked. Here is the current state:

$ ls -l /opt/bitnami/apache/htdocs
total 328
drwxrwxrwx 10 bitnami root   4096 Feb 20 16:16 app
-rwxrwxrwx  1 bitnami root   1094 Feb 20 16:16 artisan
drwxrwxrwx  2 bitnami root   4096 Feb 20 16:16 bootstrap
-rwxrwxrwx  1 bitnami root   1076 Jul  2 00:25 composer.json
-rwxrwxrwx  1 bitnami root 274159 Jul  2 00:25 composer.lock
drwxrwxrwx  5 bitnami root   4096 Feb 20 16:16 database
-rwxrwxrwx  1 bitnami root   4871 May 18 15:46 index_default.html
-rwxrwxrwx  1 bitnami root    592 Feb 20 16:16 phpunit.xml
drwxrwxrwx  2 bitnami root   4096 Feb 20 16:16 public
-rwxrwxrwx  1 bitnami root   1920 Feb 20 16:16 README.md
drwxrwxrwx  3 bitnami root   4096 Feb 20 16:16 resources
drwxrwxrwx  2 bitnami root   4096 Feb 20 16:16 routes
drwxrwxrwx  5 bitnami root   4096 Feb 20 16:16 storage
drwxrwxrwx  2 bitnami root   4096 Feb 20 16:16 tests
drwxrwxrwx 36 bitnami root   4096 Jul  2 00:46 vendor

Tried adding this to my .env file in /opt/bitnami/apache/htdocs:

FFMPEG_BINARIES=/opt/bitnami/apache/htdocs/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg
FFPROBE_BINARIES=/opt/bitnami/apache/htdocs/vendor/php-ffmpeg/php-ffmpeg/src/FFProbe

Upvotes: 0

Views: 628

Answers (1)

CeeKhe
CeeKhe

Reputation: 3

I had a problem 'unable to load ffprobe' - laravel/lumen running on ubuntu nginx and I tried to set binaries path to FFmpeg config but still not working. Then I found my solution in No environment variables are available via PHP-fpm+nginx .

In my case, ExecutableFinder (vendor/symfony/process/ExecutableFinder.php) can't find any path from getenv('PATH') .

hope this helps.

Upvotes: 0

Related Questions