NYCPHP Meetup

NYPHP.org

[nycphp-talk] broadcast emailer: is this sane strategy

drydell at att.net drydell at att.net
Mon Aug 16 23:06:49 EDT 2004


I'm not sure if it is or not, but it behaves in exactly the same way... I have several long running tasks that I can initiate from a web page, have the next page rendered in the browser immediately, and then watch the background tasks run from a UNIX shell...

> Just as an aside, it's possible to fork a detached php process, all you need 
to do is turn off stdin and stdout (and you should trap output/errors to a log):
>
> exec("/path/to/php /your/script.php 2>>/your/logfile.log >&- <&- 
>>/your/logfile.log");
>

That's what I'm doing (I think). Although -- correct me if I'm wrong -- I
believe technically that ain't true forking, as in pcntl_fork().



More information about the talk mailing list