Assuming you're working on UNIX--you need to use one of the execute
functions (search for exec in the manual). You can spawn a separate PHP
in the background in a number of way, for example, by using the screen

If I remember correctly, you can't instantiate it directly and run it in
the background because PHP does not close stdout and stderr--but this
might have changed and/or I may be mistaken (nothing new there).

php|architect - The magazine for PHP Professionals
The first monthly worldwide magazine dedicated to PHP programmers

Come visit us at!
--- Begin Message ---
I'm interested in spawing a new PHP process -- if that's the correct terminology.

The situation is that I've got a very slow loading page, where, for example, I'm using 
PHP to send, say, 1000 emails.  The user clicks submit, and, although PHP is firing 
out the emails, it appears to the user that page is hanging.  I'd like to somehow send 
that process to the background and let the page load straight-away.

In another scripting language I've used, this function was called "spawn."

Do we have something like this in PHP (I know we do!! Just can't find it.) I've looked 
through the docs but don't see what I'm looking for.

Thanks in advance.


PHP General Mailing List (
To unsubscribe, visit:

--- End Message ---
PHP General Mailing List (
To unsubscribe, visit:

Reply via email to