[nycphp-talk] PHP and running background tasks...
Hans C. Kaspersetz
hans at cyberxdesigns.com
Sat Feb 24 20:45:23 EST 2007
Brian Dailey wrote:
> Hey guys, my google-fu is failing me today so I thought I would turn
> to the brilliant minds of the NYPHP.
>
> What I'd like to do is be able to execute a php script in the
> background that does NOT impact the load time of the page itself.
> Something that runs in the background and doesn't tie up the web
> server. Does that make sense? Do any of you have any idea how one
> would accomplish this?
>
Fork off a php process and let it run separately. I think Synder, Hans
Z and Hendry were doing this for a app a couple of years ago with some
success. When the forked process is done it calls the original script
and reports. But you have to be conscious of garbage processes.
http://us3.php.net/manual/en/function.pcntl-fork.php
http://us3.php.net/pcntl
http://www.electrictoolbox.com/article/php/process-forking/
Hans K
New Jersey Web Design
http://www.cyberxdesigns.com
More information about the talk
mailing list