I have installed MAMP on my OSX and tried to run a shell command from my php file but it seems I can't access the terminal or the command is not being sent to terminal.
$cmd = "some shell command"
$output = shell_exec($cmd);
if($output == null)
echo "returned null";
else echo $output;
I'm always getting "returned null" and there shell command is not being executed. The command is correct, if I copied "some shell command" and paste it in terminal, the command gets executed. I have tested the same file in Windows and the command line is executed from php, this problem only appears in mac. So how can I access terminal in mac?
PS:
- OSX 10.6.8
- MAMP 2.0.5
- PHP 5.3.6
shell_exec()returns null on both error or no output.