Reputation: 387
I do have a PHP script which has a continuous ouptput (written to tmp file for logging). So far, I started the script right from the shell, but now, I would like to start it via shell_exec:
shell_exec("file.php >> /path/to/log 2>&1 &");
But shell_exec always return null instead of the PID. How can I get the PHP process ID and keep the output written to the file?
Thanks in advance.
Upvotes: 0
Views: 377