How can I spawn a process in a PHP page in order to start a program that survives the execution time of the request?
In other words, I want the page to have a normal lifetime (few milliseconds) but launch a program that keeps running on the server. Thanks
Use this code:
This forks the sub-process into the background and writes all of the output into
/dev/null. That way PHP continues executing the script as if there won’t be any output it has to wait for.