RE: Re[2]: how do I do FCGI_Accept() loop?
"Ron Rudman" <ron-owPOFGT/[email protected]>
| Newsgroups | gmane.comp.web.fastcgi.devel |
|---|---|
| Message-ID | <009601c60125$cdc6e6a0$6501a8c0@RONDESKTOP> |
Well that certainly explains it! Yes, I've already got it to the point where all .php files are run as fastcgi. What still throws me off is this: when I look at what processes are running I see many copies of the php binary. However, I have a particular php file that is special. I wanted *it* to be a long-running process that all the users contacted - and I expected to see multiple copies of it. -----Original Message----- From: fastcgi-developers-bounces+ron=rudman.org-xGejAJT2w6xVgU18Zptdi0EOCMrvLtNR@public.gmane.org [mailto:fastcgi-developers-bounces+ron=rudman.org-xGejAJT2w6xVgU18Zptdi0EOCMrvLtNR@public.gmane.org] On Behalf Of jlist9-FFYn/[email protected] Sent: Wednesday, December 14, 2005 9:28 PM To: fastcgi-developers-xGejAJT2w6xVgU18Zptdi0EOCMrvLtNR@public.gmane.org Subject: Re[2]: [FASTCGI] how do I do FCGI_Accept() loop? Hello Ron, I think the reason is that it's not necessary for PHP. With PHP, you don't have to implement the FCGI_Accept() loop. Instead, it can be built in into PHP. Run php -v to see if it supports fastcgi already. If it says cgi-fcgi, then it does. Otherwise, you'll need to build PHP from source with --enable-fastcgi option. Jack Wednesday, December 14, 2005, 9:02:05 PM, you wrote: > There seem to be examples of fastcgi processes written in everything > *but* PHP! Is there no sample out there anywhere or is it just not a > good idea for some reason? > -----Original Message----- > From: fastcgi-developers-bounces+ron=rudman.org-xGejAJT2w6xVgU18Zptdi0EOCMrvLtNR@public.gmane.org > [mailto:fastcgi-developers-bounces+ron=rudman.org-xGejAJT2w6xVgU18Zptdi0EOCMrvLtNR@public.gmane.org] > On Behalf Of Jon Ribbens > Sent: Wednesday, December 14, 2005 8:24 AM > To: Rares Marian > Cc: fastcgi-developers-xGejAJT2w6xVgU18Zptdi0EOCMrvLtNR@public.gmane.org > Subject: Re: [FASTCGI] how do I do FCGI_Accept() loop? > Rares Marian <[email protected]> wrote: >> I know how to get it to work in perl and C. How does it work in PHP >> or Ruby or Python? >> >> Preferably the PHP solution is what I'm looking for. >> >> Something like while FGCI_Accept()>=0 { $count=$count+1; echo $count; }. > Don't know about PHP (I don't think it works like that - it does the > Accept stuff for you), but in Python you could use my fcgi.py module > (http://jonpy.sf.net/) and the code would be: > count = 0 > class Handler(cgi.Handler): > def process(self, req): > global count > count += 1 > fcgi.Server({fcgi.FCGI_RESPONDER: Handler}).run() > (effectively the 'Accept' loop is inside the fcgi.Server.run method) > (NB the 'count += 1' may well not be thread-safe) ___________________________________ fastcgi-developers mailing list http://fastcgi.com/fastcgi-developers/