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!


In reply to FastCGI on IIS 6 almost working. by codepoke

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.