NYCPHP Meetup

NYPHP.org

[nycphp-talk] PHP and running background tasks...

Hans C. Kaspersetz hans at cyberxdesigns.com
Sat Feb 24 21:03:43 EST 2007


> 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/
>
>
I should add to my comment that you will need to call a CLI php script 
using exec to control your forked processes as you shouldn't fork from a 
web server script.  So I guess I jumped the gun.  Maybe just exec'ing 
another script will be enough.

Hans K
NJ Web Development
http://www.cyberxdesigns.com



More information about the talk mailing list