Re: system()

From: Date: Mon, 19 Feb 2001 19:25:40 +0000
Subject: Re: system()
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-40615@lists.php.net to get a copy of this message
On Monday 19 February 2001 22:47, ..s.c.o.t.t.. wrote: > is there something with the PHP system command that > makes it unable to spawn nohup background processes > > perl and PHP are closely related, so i cant really understand > how an external perl program would be able to do things that > PHP couldnt (at least in terms of this specific problem).... > would a PHP call to "system('nohup ... &')" fail, or are your > reasons for suggesting an external program based on > something else other than simple feasability? No, the reason for that wrapper program is that I know of no way in PHP to get the Process ID of the spawned program. simply calling something with "nohup" will work fine I'm sure. > > That alone won't help - "nohup" is also needed. > > What he could do is write a small Perl/C wrapper for amp, which > > launches the program in the background and returns its process id. > > Then he can do a $AmpPID = system ("launchamp $Arg"); > > > > (the wrapper would have to execute "nohup amp $Args &") > > > > and add a 'stop' link > > <a href="ampstop.php?pid=<?= $AmpPID ?>">Stop</a> > > > > And ampstop.php can do a > > system ("kill -KILL $pid"); -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) I saw God --------- and she was black.

« previous php.general (#40615) next »