I'm trying to execute ffmpeg from PHP using shell_exec or exec but it fails. Why can this be? The command /usr/bin/ffmpeg
works from the terminal, so I tried
<?php
$cmd = "/usr/bin/ffmpeg";
exec($cmd." 2>&1", $out, $ret);
if ($ret){
echo "There was a problem!\n";
print_r($out);
}else{
echo "Everything went better than expected!\n";
}
?>
and I keep on getting
There was a problem! Array ( [0] => sh: /usr/bin/ffmpeg: not found )
Any help would be greatly appreciated.
Permission on the executable are
-rwxr-xr-x 1 root root 106552 Jun 12 09:53 ffmpeg
Running which /usr/local/bin/ffmpeg
into $cmd returns an empty Array.