FastCgi Application C++ not working under Windows+Apache2

"Sebastian Beyer" <[email protected]>
Newsgroups gmane.comp.web.fastcgi.devel
Message-ID <[email protected]>
Hi, 

 

I'm simply trying to get my first test application running with fastCGI.

 

I thought with Windows and Apache2 it would be the easiest way to
start...but what a false start can you have...;-(

 

Now I'm trying to manage it here since you can't really find good sources on
google or yahoo.

 

First I did copied mod_fastcgi.dll in modules directory.

Then I did my Apache2 config

 

My config:

Apache2 httpd.conf

 

LoadModule fastcgi_module modules/mod_fastcgi.dll

 

#

# for fastCGI Apllications we use our own directory and application Handler

#

ScriptAlias /fcgi-bin/ "C:/Programme/Apache Group/Apache2/fcgi-bin/"

 

# Using fastCGI scripts the AddHandler should be used ??

AddHandler fcgi-script .fcgi

 

<Directory "C:/Programme/Apache Group/Apache2/fcgi-bin">

            AllowOverride All

            SetHandler fastcgi-script

            Options ExecCGI Includes FollowSymlinks

            Order allow,deny

            Allow from all

</Directory>

 

<IfModule mod_fastcgi.c>

            FastCgiServer "C:/Programme/Apache
Group/Apache2/fcgi-bin/myFirstFcgi.fcgi"

            FastCgiConfig -maxProcesses 5

</IfModule>

 

It says:

Apache/2.0.54 (Win32) mod_fastcgi/2.4.2 PHP/5.0.4 Server at localhost Port
80

 

So I think that worked.

 

Second I followed instructions on README of fastcgi 2.4 development-kit

 

nmake -f Makefile.nt in Directory of fastcgi...by the way. What did this do
on my machine????

 

Then I created a new C++ Project and put the libfcgi.lib in the project
directory. Afterwards I told the Linker to use the library so he could find
it.

 

Here's my test code:  -> it's an example from fastcgi.com/devel-kit or
somewhere else. 

 

CODE:

#include "fcgi_stdio.h" /* fcgi library; put it first*/

 

#include <stdlib.h> //for getenv

 

int count;

 

void initialize(void)

{

  count=0;

}

 

void main(void)

{

/* Initialization. */  

  initialize();       

 

/* Response loop. */

  while (FCGI_Accept() >= 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"));

  }

}

 

 

THird I wrote a HTML site that simply refers to my .fcig application

 

CODE:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"

      "http://www.w3.org/TR/html4/strict.dtd">

<html>

<head>

   <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

            <title>fastCgiTestformular</title>

</head>

<body>

            <h1>fastCgiTestFormular</h1>

            <p>Dieses Formular sendet an 

               <a href="http://localhost/fcgi-bin/myFirstFcgi.fcgi">
http://localhost/fcgi-bin/myFirstFcgi.fcgi

               </a>

            </p>

</body>

</html>

 

What I would expect now is that one extra process starts in TaskManager and
my application would increase the counter of count and show it to me. But
the output is always:

 

First: A messega box with         myFirstFcgi.fcgi -         Error in
Application

                                               Read Error "0x..." ... and so
on


Second on page: FastCGI Hello! (C, fcgi_stdio library)


Request number 1 running on host

 

What did I do wrong????

 

Need help urgently

 

Greetings

Sebastian Beyer

___________________________________
fastcgi-developers mailing list
http://fastcgi.com/fastcgi-developers/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.