2012-01-13 68 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; 
} 

回答