what is the pid when running php in FASTCGI server mode

what is the pid when running php in FASTCGI server mode

am 05.10.2007 23:04:57 von ebeard

I have replaced apache with nginx and now run php in FASTCGI server
mode like this:

PHP_FCGI_CHILDREN=6 php -b 127.0.0.1:9086 -c /my/php/ini/path

nginx reverse proxies to php and this works great!

Now I want to monitor the php processes using monit but it requires a
pid file. Here's the question. How do I generate these pid files? I
would like them to be /var/run and be in the form of:

php.9086.pid


where the number is the port the php process is bound to.

Thank you for any insight into this problem.

ebeard.

Re: what is the pid when running php in FASTCGI server mode

am 05.10.2007 23:28:53 von Steve

"ebeard" wrote in message
news:1191618297.730678.157670@o3g2000hsb.googlegroups.com...
>I have replaced apache with nginx and now run php in FASTCGI server
> mode like this:
>
> PHP_FCGI_CHILDREN=6 php -b 127.0.0.1:9086 -c /my/php/ini/path
>
> nginx reverse proxies to php and this works great!
>
> Now I want to monitor the php processes using monit but it requires a
> pid file. Here's the question. How do I generate these pid files? I
> would like them to be /var/run and be in the form of:
>
> php.9086.pid
>
>
> where the number is the port the php process is bound to.

the webserver is 'bound' to a port. php is a deferred application spun off
of the webserver.

Re: what is the pid when running php in FASTCGI server mode

am 06.10.2007 00:18:07 von ebeard

On Oct 5, 5:28 pm, "Steve" wrote:
> "ebeard" wrote in message
>
> news:1191618297.730678.157670@o3g2000hsb.googlegroups.com...
>
> >I have replaced apache with nginx and now run php in FASTCGI server
> > mode like this:
>
> > PHP_FCGI_CHILDREN=6 php -b 127.0.0.1:9086 -c /my/php/ini/path
>
> > nginx reverse proxies to php and this works great!
>
> > Now I want to monitor the php processes using monit but it requires a
> > pid file. Here's the question. How do I generate these pid files? I
> > would like them to be /var/run and be in the form of:
>
> > php.9086.pid
>
> > where the number is the port the php process is bound to.
>
> the webserver is 'bound' to a port. php is a deferred application spun off
> of the webserver.

in this case it is not bound to the webserver. php is started up
separately and the server, nginx, reverse proxies to the php process
running.

Re: what is the pid when running php in FASTCGI server mode

am 07.10.2007 13:47:05 von colin.mckinnon

On 5 Oct, 23:18, ebeard wrote:
> On Oct 5, 5:28 pm, "Steve" wrote:
>
>
>
> > "ebeard" wrote in message
>
> >news:1191618297.730678.157670@o3g2000hsb.googlegroups.com.. .
>
> > >I have replaced apache with nginx and now run php in FASTCGI server
> > > mode like this:
>
> > > PHP_FCGI_CHILDREN=6 php -b 127.0.0.1:9086 -c /my/php/ini/path
>
> > > nginx reverse proxies to php and this works great!
>
> > > Now I want to monitor the php processes using monit but it requires a
> > > pid file. Here's the question. How do I generate these pid files? I
> > > would like them to be /var/run and be in the form of:
>
> > > php.9086.pid
>
> > > where the number is the port the php process is bound to.
>
> > the webserver is 'bound' to a port. php is a deferred application spun off
> > of the webserver.
>
> in this case it is not bound to the webserver. php is started up
> separately and the server, nginx, reverse proxies to the php process
> running.

There's nothing to stop you dropping the file from PHP - but this will
only occur when PHP is servicing a request, therefore not suitable for
your purposes. Also, you'd need to determine if PHP maintains the same
processes after starting in fast CGI mode - AFAIK thats not a
requirement.

I suggest you find a different way to solve the problem not using
monit.

C.