I would like to execute commands in a php script like this:
<?php
shell_exec(php myfile.php)
or
<?php
shell_exec(ffmpeg -i ...)
My problem, i think is that php and ffmpeg path are not properly configured in my apache environment because when i execute this:
<?php
var_dump(shell_exec("which php"));
var_dump(shell_exec("which ffmpeg"));
I get this answer:
string '/usr/bin/php' (length=13)
null
But in the terminal when i type:
which php
which ffmpeg
I get this answer:
/usr/local/opt/php55/bin/php
/usr/local/bin/ffmpeg
So how can i set properly the php and ffmpeg environment path without always retype the complete path ?
I am under Mac OsX 10.10 and i installed php and ffmpeg whith brew.