Re: PHP as daemon process

From: Date: Wed, 16 Apr 2003 12:06:49 +0000
Subject: Re: PHP as daemon process
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-144103@lists.php.net to get a copy of this message
In article <002201c303e1$800bd590$030ba8c0@ipa>, ilja.polivanovas@assis.lt says... > > > > > > Hallo all > > > > Hallo. > > > > > Does anybody know how to run PHP script via PHP-CLI as daemon process > in > > > Linux or FreeBSD? > > > > Well, which? Are you running it from a CLI, or as a daemon? Or are you > > talking about launching the daemon from a CLI? > > i'm talking about PHP script which runs as daemon (may not be CLI). > > > > > Making a PHP script act as a daemon is pretty straightforward. Since > > the script can pass data through stdio, you can run a daemon that gets > > launched from inetd (or equivalent). If you want the script to accept > > TCP socket connections, a close read of > > http://www.php.net/sockets > > should help to dispel the fog. The page even includes a pair of client > > and server script examples. > > > > No problem with soceket client-server, was talking about detaching from > shell. php -q script.php & is killed after closing shell. > That is the > problem. > > > In other words, RTFM. > > > Reading about PCNTL now :/ nohup will let the process continue after logout/shell closing. Cheers -- Quod subigo farinam $email =~ s/oz$/au/o;

« previous php.general (#144103) next »