[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Fastcgipp-users] Timeout waiting for output from CGI script

From: Jean-Christophe Roux
Subject: [Fastcgipp-users] Timeout waiting for output from CGI script
Date: Mon, 13 Apr 2009 06:07:20 -0700 (PDT)


Great project!

I downloaded and installed without any issuer fastcgi++-2.0alpha-81f89e4e.tar.bz2  but I am struggling with my helloworld program

main.cpp is below and is a simplified version of one found in the examples.
I am running Apache 2.2 on Centos 5

compilation goes fine but when I try to access the webpage through a browser, loading the page take a while and the page is blank., I am getting the following error message as logged by Apache:
 Premature end of script headers: a.out
 Timeout waiting for output from CGI script /some_path/cgi/a.out

Thanks for any help

Below are the main.cpp file and a portion of my httpd.conf file 

httpd.conf contains
<Directory some_path>
  Options +ExecCGI
  AddHandler cgi-script .cgi .jcr .out .toff

#include <boost/date_time/posix_time/posix_time.hpp>
#include <fstream>
#include <fastcgi++/request.hpp>
#include <fastcgi++/manager.hpp>

void error_log(const char* msg)
   using namespace std;
   using namespace boost;
   static ofstream error;
   {"/tmp/errlog", ios_base::out | ios_base::app);
     error.imbue(locale(error.getloc(), new posix_time::time_facet()));
   error << '[' << posix_time::second_clock::local_time() << "] " << msg << endl;
class HelloWorld: public Fastcgipp::Request<wchar_t>
  bool response()
    out << "Content-Type: text/html; charset=utf-8\r\n\r\n";
    out << "hello my friend" << "<br />";
    err << "Hello apache error log";

    return true;

int main()
    Fastcgipp::Manager<HelloWorld> fcgi;
  catch(std::exception& e)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]