This is what I am using.
But I do have another question, how can I set the PATH for commands?
If I run "php -f test.php"
// Outputs all the result of shellcommand "ls", and returns
// the last output line into $last_line. Stores the return value
// of the shell command in $retval.
$last_line = system('ls', $retval);
// Printing additional info
<hr />Last line of the output: ' . $last_line . '
<hr />Return value: ' . $retval;
the result is:
sh: /usr/local/php/bin/ls: No such file or directory