FFmpeg - PHP 127 error code

I am trying to execute ffmpeg with php. I installed FFmpeg-php and the extension is in the modules directory and it displays in phpinfo. FFmpeg is working fine, since I can run the command in the terminal and output the video. However, when I try to run a command from php using the following script:

exec(ffmpeg -i input.avi output.avi);

But I get the error code "127".

The extension is loaded using:

$extension      = "ffmpeg";
$extension_soname   = $extension . "." . PHP_SHLIB_SUFFIX;
$extension_fullname = PHP_EXTENSION_DIR . "/" . $extension_soname;

// Locate Extension
define('FFMPEG_LIBRARY', '/usr/local/bin/ffmpeg');

// Load Extension
if (!extension_loaded($extension))
    echo dl($extension_soname) or die("Can't load extension $extension_fullname\n");

I also tried to determine the location of the aboslute extension in the command:

exec(/usr/local/bin/ffmpeg-i input.avi output.avi);

Again, this works in the terminal, but still returns the same erro code using php exec ().

Does anyone have any ideas?

Thank.

+3
source share
2 answers

, php-ffmpeg api exec. exec , ( , ).

ffmpeg ( , ), ffmpeg status 127 error, , ffmpeg.

+3

(ffmpeg exec/system)

, /usr/bin/ffmpeg ffmpeg

+1

Source: https://habr.com/ru/post/1788472/


All Articles