Re: Try to find a solution, when restart Apache with PHP Script

From: Date: Mon, 17 Sep 2007 16:26:21 +0000
Subject: Re: Try to find a solution, when restart Apache with PHP Script
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-262167@lists.php.net to get a copy of this message
Jim, i've already look for pcntl... but the support server guys, tell me that they can't install php modules that are not pre-compiled... so, pcntl is not an alternative... I think you are right... i have to make this script a daemon... but how can i do that with php??... the problem is that this daemon should be started in web interface... see the problem...??? thanks Jim Lucas escreveu:
Rodolfo De Nadai wrote:
Edward , my best guess is that not IE is holding the connection but the apache user... because the process is related to the apache user... and there's more i can close IE, bacause i use the directive 2> log.log & on the call of system. Example: system("php myscript.php 2> log.log &"); This why IE will not wait until the script is finish... One thing i can't understand is why this child process of the apache user is not killed when i restart apache... that's the real deal... thanks
This doesn't actually start a new process of PHP seperate from Apache. What you are doing is starting a child process of the child process or the root process of Apache. What you might want to look in to is http://us2.php.net/manual/en/ref.pcntl.php This will help you fork your processes, but I think you are still going to run into the same problem even if you fork it within the php process of apache. What you are probably going to need to do is create your own custom script that will act as a daemon, and replace apache altogether. This way it is completely separate from apache. It can run on its own port and only answer to you.
-- * Rodolfo De Nadai * * Analista de Sistema Jr. - Desenvolvimento * *Informática de Municípios Associados S.A.* Seu governo mais inteligente rodolfo.denadai@ima.sp.gov.br <mailto:rodolfo.denadai@ima.sp.gov.br> - www.ima.sp.gov.br <http://www.ima.sp.gov.br/> Fone: (19) 3739-6000 / Ramal: 1307

« previous php.general (#262167) next »