[FASTCGI] Fcgi_accept() returning -1

Sekine Coulibaly sekine.coulibaly at withings.com
Sun Feb 6 08:17:38 EST 2011


Hi there,

I have the fastcgi module up un running with an Apache 2 server.

My apache2 configuration file apache2.conf regarding to fastcgi is as follow :

<IfModule mod_fastcgi.c>
    Alias /cgi-bin/ /usr/cgi-bin/

    <Directory /usr/cgi-bin/>
        SetHandler fastcgi-script
        Options +ExecCGI
        allow from all
    </Directory>

    AddHandler fastcgi-script *

    FastCgiServer /usr/cgi-bin/myprocess -processes 5
</IfModule>

In the /usr/cgi-bin, I have a binary name myprocess, written in C, as follows :

#include <stdio.h>
#include "fcgi_stdio.h"
   
int main ( int argc , char **argv )
    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_NAME"));
    }
}

My problem is that myprocess returns after just one iteration of FCGI_Accept(), as if it was in "CGI" mode, not "FASTCGI". Looks like FCGI_Accept() returns -1.
No error in error or access Apache2 logs.

Any idea ? Shall I switch to a "fastcgi" mode anywhere ? Aditionnaly, can I set the module configuration in my Virtual Host instead ?

Thanks for your help !


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.pins.net/mailman/private.cgi/fastcgi-developers/attachments/20110206/4cd3e11d/attachment.html>


More information about the FastCGI-developers mailing list