I wish to run a PHP script in the background. Its basically supposed to run forever, and perform a task.
I can trigger it from the browser, and it runs perfectly, so I know that there is no problem in the script itself. Can someone tell me how I can trigger it through a PHP script?
Here is what I've tried, but its not working:
$output = array();
$returnVal = 0;
exec("/usr/bin/php tweet_collector.php > /dev/null &", $output, $returnVal);
$log->message('\'exec\' command executed to start tweet_collector');
$log->message("Return Value: $returnVal. Output: " . implode('|', $output));
The output that I get in my log is:
"Return Value: 0. Output: "