Re: asynchronous launch of a script
| From: | David Harkness | Date: | Tue, 28 Jun 2011 22:02:47 +0000 |
| Subject: | Re: asynchronous launch of a script | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-313801@lists.php.net to get a copy of this message | ||
On Tue, Jun 28, 2011 at 1:02 PM, Stuart Dallas <stuart@3ft9.com> wrote:
> While this will work, I would caution against doing this, especially when
> using Apache as the web server. . . .
>
> Forking an HTTP request handler can lead to some very unwelcome
> side-effects. I'd urge you not to do this. It may appear to work for a
> while, but I guarantee you'll live to regret it.
Thank you, Negative Nancy. :) Those are excellent points, and luckily we're
doing this for an infrequently run internal report that runs on a machine
that doesn't do much else.
Alternatively, you can use & in bash or some other shell to spawn a
background job, and I suppose you could create a wrapper shell script that
does that calls php in the background. But there must be a direct way using
an alternate to exec().
David