FastCGI interface (PLP::CGI extension using FCGI)
authorMischa POSLAWSKY <perl@shiar.org>
Tue, 2 Oct 2007 10:23:27 +0000 (12:23 +0200)
committerMischa POSLAWSKY <perl@shiar.org>
Mon, 17 Mar 2008 19:42:36 +0000 (20:42 +0100)
commit0dbf6bc1fe5cd28c532994d13836e9509fcbe194
tree1f5eb9b880012ce36c622718afb09b260dc828f0
parent4565100c67dd7b0344e9eb332296d5fa64e7611b
FastCGI interface (PLP::CGI extension using FCGI)

Do not exit from PLP::CGI, allowing it to be used consecutively.

Coincidentally, PLP::FastCGI does just that: extending the PLP::CGI
interface to handle FCGI requests. Its import() runs a PLP dispatcher,
so a FastCGI executable (example plp.fcgi is provided) only has to
C<use PLP::FastCGI>. If a server supports run arguments, a wrapper
script isn't even needed this way: just do /usr/bin/perl -MPLP::FastCGI.

PATH_TRANSLATED is explicitly removed from environment so file names are
gotten from SCRIPT_*, which mostly already point to the requested script
(at least much more correctly than can be determined from PATH_*).

This seems to work correctly on at least:
- Apache 1.3.34, 2.2.4, 2.2.8 with mod_fastcgi and mod_fcgid
- Lighttpd 1.4.7 and 1.4.18 with mod_fastcgi

Caching can be controlled by setting an environment variable PLP_CACHE
(unlike with mod_perl, no other means of configuration are provided).
If not specified, PLPcache will be turned on.

fcgi script
PLP/CGI.pm
PLP/FastCGI.pm [new file with mode: 0644]
plp.fcgi [new file with mode: 0755]