I can see the result of:
echo exec("whoami"); // will output "www-data"
however if I try to run a real world command:
echo exec("casperjs myscript.js /foo/bar");
then nothing happens:
I've searched on StackOverflow, and went to try alternative ways (tested first in the shell, to be sure they work):
echo exec("casperjs /absolute/path/to/myscript.js");
echo exec("/usr/local/bin/casperjs /absolute/path/to/myscript.js");
I tested also other combinations, using system()
, shell_exec()
and even passthru()
but it's always the same thing: no error, no output, even in php log files, so it is very, very hard to understand the problem :(
Try echo exec("casperjs myscript.js /foo/bar 2>&1");
to redirect stderr to stdout which wouldn't otherwise show.
It could be an error in your cmdline or maybe casperjs is not in your $PATH, etc.