Perl and FastCGI, can't get it to work
Posted by: doowttam
Posted on: 2008-07-26 16:17:00
I'm can't seem to get Perl and FastCGI to work. My script is the basic helloworld script on the wiki:
#!/usr/bin/perl
use lib qw( /home/myusername/local/lib/perl/5.8.8 );
use FCGI;
use Socket qw( :crlf ); # server agnostic line endings in $CRLF
my $counter = 0;
while ( FCGI::accept() >= 0 ) {
$counter++;
print
"Content-Type: text/plain",
$CRLF,
$CRLF,
"Hello World, in Perl FastCGI!",
$CRLF,
"I am process $$.",
$CRLF,
"I have served $counter request(s).",
$CRLF;
}
The script runs fine if I try to just run it. My .htaccess file looks like this:
Options +ExecCGI
AddHandler fastcgi-script .fcgi
RewriteEngine On
RewriteRule ^(test/script/dispatch\.fcgi/.*)$ - [L]
RewriteRule ^(.*)$ test/script/dispatch.fcgi/$1 [PT,L]
But, but whenver I visit my domain I get these (not very helpful) error messages in my error.log:
[Sat Jul 26 16:07:01 2008] [error] [client 12.216.230.180] FastCGI: comm with (dynamic) server "/mnt/local/home/myusername/catalyst-test.mydomain.com/test/script/dispatch.fcgi" aborted: (first read) idle timeout (60 sec)
[Sat Jul 26 16:07:01 2008] [error] [client 12.216.230.180] FastCGI: incomplete headers (0 bytes) received from server "/mnt/local/home/myusername/catalyst-test.mydomain.com/test/script/dispatch.fcgi"
Any ideas or troubleshooting tips?