Re: spawing new PHP process
| From: | Geranium | Date: | Wed, 27 Nov 2002 09:38:08 +0000 |
| Subject: | Re: spawing new PHP process | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-126251@lists.php.net to get a copy of this message | ||
In article <sde386b0.042@ccp2.jhuccp.org>, Robert McPeak
<RMCPEAK@jhuccp.org> wrote:
> I have other situations where I would like to somehow "spawn" a new php
> process so that the page loads quickly and my user doesn't get frustrated or
> confused.
Hang on, there's lots of talking around the point here. This is not
hard. Look in the manual under pcntl_fork. This will let you create a
separate process that stays running all the time (not just when you're
running a web page) and you can send commands to either using
pcntl_signal (docs are out of date - also look up "ticks") or through
your database. You will need to have the CGI version of PHP installed,
as well as mod_php - and in 4.3 this happens very easily.
Having said all that, I've run into a separate probem further down the
road doing just what you're wanting to do. My back-end process runs
perfectly with no problems but after 5 mins or so starts generating
"chunk/page already free" errors, then crashes. Looks to be a bug in
there somewhere, but not sure where yet.