2012-01-13 110 views
1

我精通FastCGI的C++项目,将可执行文件复制到www目录,通过浏览器打开 - 并得到500错误(超时豁免)。我错了什么?FastCGI和Apache和C++

操作系统的Ubuntu 10.05,服务器:Apache

源C++代码:

#include <fcgi_stdio.h> /* fcgi library; put it first*/ 
#include <fcgiapp.h> 
#include <cstdlib> 
#include <iostream> 

using namespace std; 
int count; 

int main(int argc, char** argv) { 


    /* Response loop. */ 
     while (FCGI_Accept() >= 0) { 
     cout<<"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"; 
     } 
    return 0; 
} 

回答