Re: PHP as daemon process
| From: | Ilja Polivanovas | Date: | Wed, 16 Apr 2003 06:29:13 +0000 |
| Subject: | Re: PHP as daemon process | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-144068@lists.php.net to get a copy of this message | ||
> >
> > 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/socketsIeݦÏꔥ
> ±æ@uÝ®
> 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 :/