Re: Windows NT and FastCGI

Benjamin Gavin (
Wed, 27 Aug 1997 16:45:40 -0500

Message-Id: <>
Date: Wed, 27 Aug 1997 16:45:40 -0500
From: Benjamin Gavin <>
Subject: Re: Windows NT and FastCGI

  I ran the echo program and had the same problem.  I started with the
QUERY_STRING=hello, and then proceeded to change it over and over, but no
matter what the page that was returned got QUERY_STRING=hello.  The PID
stayed the same, and the count incremented, but no change to the query
string.  I'll answer your question below to see if you have any more ideas:

>1) What version of the FastCGI libraries are you using?

>2) What is your app written in?
  C++, Microsoft Visual C 5.0

>3) Have you tried the experiment of posting to "echo" for example
>   to see the different variables?
  Yes, as described above.  Just for informations sake I'll give you the
configuration that I am using.  Windows NT 4.0 Workstation, IIS 3.0,
Pentium 133, 48MB RAM.  Not sure what else you would need.  I can run the
program fine using it as CGI, but opening VERY expensive database
connections is very slow with regular CGI.  I also compiled the libraries
with MFC compatibility since I am going to be doing database accesses.  Any
other ideas??

Thanks for your reply,

P.S.  I have also recieved letters from others saying they had the same
problem and asking that I forward a solution if one is found.

>I just ran a GET against the echo.c application and each time sent
>an HTTP header called foo and changed the value each time I issued
>the request.  Each time there was a new variable seen by the echo
>application and the counter was incrementing.
>- Bill -
>At 12:23 PM 8/27/97 -0500, you wrote:
>>Hi all,
>>  I don't know what happened to my last post, so I'll send another.  Sorry
>>if the same thing shows up twice...
>>  I am having MAJOR problems with FastCGI under Windows NT.  It seems that
>>no matter how I change the environment variables between calls to the
>>FastCGI process, They DO NOT CHANGE according to the FastCGI process
>>itself.  A simple example will illustrate the point...
>>1a)  Submit form using GET, content-length=50
>>  result:  FastCGI program starts up, gets correct data.
>>2a)  Change form submittal to POST, content-length=50
>>  result:  Still reads from the original QueryString, as if GET was used.
>>1b)  Submit form using POST, content-length=30
>>  result:  FastCGI program starts up, get correct data
>>2b)  Submit form using POST, content-length=29
>>  result:  FastCGI program tries to read 30, gets bogus last character
>>3b)  Submit form using POST, content-length=31+
>>  result:  FastCGI reads only first 30 characters
>>4b)  Submit form using GET, content-length=30
>>  result:  30 random characters read from standard input, sometimes
>>           kills program, sometimes continues with bogus info.
>>As far as I can tell the FastCGI program gets only one set of environment
>>variables.  It gets whatever set it is started up with, but no more.  No
>>matter what changes I make to the environment variables, there are no
>>changes to the FastCGI programs environment after the first call.  This
>>works fine if the method is POST and each input set has the exact same
>>content-length, but how often does that happen???  It doesn't matter how I
>>get the environ variables, using FCGX_GetParam, or getenv.
>>Please, I need FastCGI's speed improvements.  I DO NOT want to port the
>>existing program into an ISAPI dll... YUCK!!  Any ideas would be
>>Ben Gavin