[FASTCGI] fastcgi, iostream, vector

Jean-Christophe Roux jcxxr at yahoo.com
Sat Jun 12 23:58:13 EDT 2010


Hello,
I am using fastcgi on a Centos 5 box with nginx.
The following program compiles (g++) and runs properly from the command line but it fails when run through a browser:
The error in the logs is something like:  upstream closed prematurely FastCGI stdout while reading response header from upstream
If, instead of <iostream>, I include <vector> the failure is the same. 

I don't quite understand what the problem is. Could someone explain me the problem or points me to a good reference on it.

Thank you

      1 #include "/usr/local/include/fcgi_stdio.h"
      2 #include <stdlib.h>
      3 #include <iostream>
      4
      5 int main(void)
      6 {
      7   while (FCGI_Accept() >= 0)
      8   {
      9     printf("Content-type: text/html\n\n");
     10     printf("hello");
     11   }
     12   return EXIT_SUCCESS;
     13 }



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


More information about the FastCGI-developers mailing list