I don't understand why, but I can't execute some binaries from a PHP page.
If I call this from a PHP page, I don't get any output:
<?php
echo shell_exec('/usr/bin/which ffmpeg');
If I execute it from CLI, it works:
$ sudo -u apache php -r 'echo shell_exec("/usr/bin/which ffmpeg");'
/usr/bin/ffmpeg
But if I try to call whereis
instead of which
from a PHP page, I do get an output although they are in the same directory:
<?php
echo shell_exec('/usr/bin/whereis ffmpeg');
I don't understand the logic behind...
I've verified the file permissions, and everything seems fine: -rwxr-xr-x. root:root
, and there's is no ACL.
I'm using Fedora 28 (SELinux is set to permissive). These commands work on Debian and Ubuntu.