title: How to configure Perl/FCGI (FastCGI) with IIS 7.5?
body: <p>I'm trying to get Perl/FastCGI (FCGI) running with IIS 7.5. The version of <code>C:\Windows\System32\inetsrv\iisfcgi.dll</code> is <code>7.5.7601.17514</code>. Here's my <code>web.config</code> and my Perl script:</p>
  
  <pre><code>D:\MiLu\Dev :: more /t1 web.config
  &lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;configuration&gt;
   &lt;system.webServer&gt;
    &lt;directoryBrowse enabled="true" /&gt;
    &lt;handlers&gt;
     &lt;add name="FCGI" path="*.pl" verb="*"
      modules="FastCgiModule"
      scriptProcessor="C:\Opt\Cygwin\bin\perl.exe"
      resourceType="Unspecified" requireAccess="Script" /&gt;
    &lt;/handlers&gt;
   &lt;/system.webServer&gt;
  &lt;/configuration&gt;
  
  D:\MiLu\Dev :: more /t4 Perl\fcgi\count.pl
  use strict;
  use warnings;
  use FCGI;
  
  my $count = 0;
  my $request = FCGI::Request();
  
  while ( $request-&gt;Accept &gt;= 0 ) {
      print "Content-type: text/html\r\n\r\n", ++$count;
  }
  </code></pre>
  
  <p>All I'm getting is a 500 with a generic error page from IIS stating "The FastCGI process exited unexpectedly" and listing possible error causes.</p>
  
  <p>The script runs fine from the command line, printing its three lines and then exiting immediately, indicating that script and module installation are alright. (I copied it from the <a href="http://p3rl.org/FCGI">FCGI manual</a>, by the way, so it should be okay.)</p>
  
  <pre><code>D:\MiLu\Dev :: C:\Opt\Cygwin\bin\perl.exe Perl\fcgi\count.pl
  Content-type: text/html
  
  1
  </code></pre>
  
  <p>There is an <a href="http://p3rl.org/FCGI%3a%3aIIS"><code>FCGI::IIS module</code></a>, however, it appears to have worked only for IIS 5.1 and 6.0.</p>
  
  <ul>
  <li><a href="http://www.cosmicscripts.com/servers/fastcgi_perl.html">FastCGI and Perl - FastCGI with Perl on IIS 5.1, 6</a></li>
  <li><a href="http://en.wikibooks.org/wiki/IIS_and_FastCGI/Scripting_languages/Perl">IIS and FastCGI/Scripting languages/Perl</a></li>
  </ul>
  
  <p>The fact that there is a dedicated FCGI module for IIS suggests that IIS 5.1 and 6.0 provided their own non-standard FCGI implementation. So if this were true, what about IIS 7.5 then? Quite a lot of uncertainties.</p>
  
  <p>The author of <code>FCGI::IIS</code> <a href="http://forums.iis.net/t/1146580.aspx">seems to have tried to make his module work with IIS 7.0 (Getting Perl working on IIS7 with FastCGI - 2007)</a>, but given up.</p>
  
  <p>Where can I find something more concrete as to what the error is? Is there a log file? What should I be looking for in the Windows event viewer (eventvwr)?</p>
  
  <p>Is there some magic incantation for IIS that I'm missing?</p>
  
  <p>There's not much information out there on this combination. But it might work, in the end. There is a <a href="http://www.iis.net/ConfigReference/system.webServer/fastCgi/application">FastCGI Application configuration reference page</a> here, and <a href="http://wiki.catalystframework.org/wiki/deployment/iis7_fastcgi">someone has got Catalyst to work with FastCGI on IIS 7.0 (Catalyst+IIS 7.0 on MS Windows 2008/Vista)</a>.</p>