codepoke has asked for the wisdom of the Perl Monks concerning the following question:
I'm so close! I've written a few CGI scripts years ago, but I'm a perl weakling.
This code fails when run through FastCGI:
#!c:/perl/bin/perl use CGI::Fast;
With this error:
Error! Can't locate object method "FILENO" via package "FCGI::Stream" at C:/Perl/lib/CGI.pm line 822. Compilation failed in require at C:/Perl/lib/CGI/Fast.pm line 20. BEGIN failed--compilation aborted at C:/Perl/lib/CGI/Fast.pm line 20. Compilation failed in require at (eval 4) line 4. BEGIN failed--compilation aborted at (eval 4) line 4.
But, if I tell FastCGI to reference the script directly, the following code runs perfectly. It keeps the same PID across multiple calls, increments the counter as expected, etc.
#!c:/perl/bin/perl -w use strict; use CGI::Fast; my $count = 1; while (my $q = CGI::Fast->new) { print("Content-Type: text/plain\n\n"); print("Process ID: $$; Count is: " . ++$count); }
The difference is in the fcgiext.ini.
Here's the config that fails:
[Types] fcgi=FCGI [FCGI] ExePath=C:\perl\bin\perl.exe Arguments="-MFCGI::IIS=eval"
Here's the config that succeeds:
[Types] fcgi=FCGI [FCGI] ExePath=C:\perl\bin\perl.exe Arguments=d:\inetpub\cgi-bin\hello.fcgi
Of course, the config that succeeds will only run that one script, and that's a bad thing.
It seems evident I've misconfigured FastCGI somehow in such a way as when it calls my perl script, perl cannot build out its environment correctly. Any insights into what I might have done wrong in FastCGI? Is there some environmental argument I might be missing in perl?
Thanks!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: FastCGI on IIS 6 almost working. (fix)
by tye (Sage) on Aug 14, 2010 at 05:09 UTC | |
by codepoke (Initiate) on Aug 16, 2010 at 17:49 UTC |