[FASTCGI] Apache 2.2.13 Server on Windows + FastCGI

sauda.furkhana at wipro.com sauda.furkhana at wipro.com
Sat Sep 5 00:18:19 EDT 2009


Hi Panter,

I quickly tried out with your advice, this is the sample code I'm trying
out with,

#include "fcgi_stdio.h"
#include "fcgiapp.h"
#include <stdlib.h>
#include "stdafx.h"
extern "C" _declspec (dllimport) int FCGX_Accept(FCGX_Stream **in,
FCGX_Stream **out, FCGX_Stream **err, FCGX_ParamArray *envp);

int main(int argc, char* argv[])
{
	int count = 0;
	while(FCGX_Accept( &FCGI_stdin->fcgx_stream,
&FCGI_stdout->fcgx_stream, &FCGI_stderr->fcgx_stream, &environ ) >= 0)
	{

    printf("Content-type: text/html\r\n"
           "\r\n"
           "<title>FastCGI Hello! (C, fcgi_stdio library)</title>"
           "<h1>FastCGI Hello! (C, fcgi_stdio library)</h1>"
           "Request number %d running on host <i>%s</i>\n",
            ++count, getenv("SERVER_HOSTNAME"));

		printf("Hello World!\n");
		printf("Hello FCGI!\n");
		printf("Hello ALEX!\n");
	}
	return 0;
}

Changed FCGI_Accept to FCGX_Accept. 
When I execute the binary, I'm getting "Unknown listentype <0>" message
as output!!! Earlier the content would get printed but server name was
output as (null).

What's going wrong?

-----Original Message-----
From: panter at gmx.de [mailto:panter at gmx.de] 
Sent: Thursday, September 03, 2009 7:19 PM
To: Sauda Furkhana (WT01 - Telecom Equipment);
fastcgi-developers at mailman.fastcgi.com
Subject: Re: [FASTCGI] Apache 2.2.13 Server on Windows + FastCGI

did this to get getenv working on windows for fcgi:
 while(FCGX_Accept( &FCGI_stdin->fcgx_stream, &FCGI_stdout->fcgx_stream,
&FCGI_stderr->fcgx_stream, &environ ) >= 0)
instead of
 while(FCGI_Accept() >= 0)

-------- Original-Nachricht --------
> Datum: Thu, 3 Sep 2009 08:49:39 +0530
> Von: sauda.furkhana at wipro.com
> An: fastcgi-developers at mailman.fastcgi.com
> Betreff: [FASTCGI] Apache 2.2.13 Server on Windows + FastCGI

> HI,
> 
>  
> 
> I could finally get Apache working with my sample code mentioned here.

> 
>  
> 
> Thanks, Will Hawes - for sharing the latest dll with me!!
> 
>  
> 
> Now when I deploy one of my other applications there seems to be
problem
> in the way environment variables are read in FastCGI.
> 
> Basically, I'm converting a CGI application of mine to FastCGI. And
the
> code which has getenv()'s does not work as expected in FastCGI.
> 
> For example,
> 
> If the URL is http://localhost:8080/cgi-bin/ALEXwin/alex?ac=toolbar
> 
> QUERY_STRING in CGI retrieves "ac=toolbar" where in FastCGI retrieves
as
> (NULL)
> 
> SCRIPT NAME in CGI retrieves "/cgi-bin/ALEXwin/" whereas in FastCGI
> retrieves as "/"
> 
>  
> 
> I'm looking out for a solution for the same; may be I will I have to
> modify getenv() to work inline with FastCGI.
> 
>  
> 
> Any help would be highly appreciated!!
> 
> 
> Please do not print this email unless it is absolutely necessary. 
> 
> The information contained in this electronic message and any
attachments
> to this message are intended for the exclusive use of the addressee(s)
and
> may contain proprietary, confidential or privileged information. If
you are
> not the intended recipient, you should not disseminate, distribute or
copy
> this e-mail. Please notify the sender immediately and destroy all
copies of
> this message and any attachments. 
> 
> WARNING: Computer viruses can be transmitted via email. The recipient
> should check this email and any attachments for the presence of
viruses. The
> company accepts no liability for any damage caused by any virus
transmitted
> by this email. 
> 
> www.wipro.com

-- 
Jetzt kostenlos herunterladen: Internet Explorer 8 und Mozilla Firefox 3
-
sicherer, schneller und einfacher! http://portal.gmx.net/de/go/atbrowser

Please do not print this email unless it is absolutely necessary. 

The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. 

WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. 

www.wipro.com


More information about the FastCGI-developers mailing list