fastcgi - Perl how to detect if running under Fast CGI FCGI -
If this is called under FCGI or CGI then how can I find out inside the Perl script? If FCGI is running, then load the FCGI module, something like this on top of the script:
if ($ ENV {FCGI}) {Use FCGI; Use MyFCGIHandler; }
I know that I can do something like this:
Use FCGI; My $ request = FCGI :: request (); # Back or no, the program was run as a FastCGI or not $ isfcgi = $ req- & gt; IsFastCGI ();
But that means that I have to load Fsijiai module and its request and isFastCGI methods say to check if that is not running the app under Fsijiai is not so good .
found it on:
#! Use / usr / bin / perl strict; Use warnings; Use CGI :: Fast QW (standard); Sub modes {my $ h = $ CGI :: Fast :: Ext_Request; If (defined ($ H) & amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; & amp; nbsp; IsFastCGI ()) {return 'FastCGI'; } Other {Return 'CGI'; }} While (CGI :: Fast> new ()) {print header (), Start_html ( "CGI or Fastsijiai?"), H1 ( "CGI or Fastsijiai? '), P (" This application shows' Mode (), 'mode'), end_html (); }
Comments
Post a Comment