If you do not want to create the pcntl extension, a good alternative is to use proc_open ().
http://www.php.net/manual/en/function.proc-open.php
Use this with stream_select () so that your PHP process can sleep until something happens with the child process you created.
This will effectively create the process in the background without blocking the parent PHP process. You, PHP, can read and write in STDIN, STDOUT, STDERR.
To complete the browser download (stop the download progress indicator), you can use what Milan Babushkov mentioned.
The key for the browser to consider that the HTTP request is complete is to send it the length of the content. To do this, you can start buffering the request and then clear it after sending the Content-Length header.
eg:
<?php ob_start(); // render the HTML page and/or process stuff header('Content-Length: '.ob_get_length()); ob_flush(); flush(); // can do more processing ?>
bucabay
source share