以下は私のC++コードと私の設定ファイルです。nginxとC++でfastcgiを動作させようとしています
私はspawn-fcgi -a120.0.0.1 -p9000 -n ./rtb.o
を実行したときに、私はここでは、このエラーに
spawn-fcgi: exec failed: Exec format error
を取得するには、私はそうrtb.o
#include "fcgi_stdio.h"
#include <stdlib.h>
using namespace std;
int main()
{
int count = 1;
while(FCGI_Accept() >= 0)
printf("Content-type: text/html\r\n"
"\r\n"
"<title>FastCGI Hello!</title>"
"<h1>FastCGI Hello!</h1>"
"Request number %d running on host \n",
++count);
return 0;
}
として遵守し、私のC++コードで、私は間違って何をしましたか?
注:sudo spawn-fcgi -d/var/www/-f /var/www/rtb.o -a 127.0.0.1 -p 9000これはうまく動作し、出力spawn-fcgi:child spawned successfully:PID :../src/rtb.cpp の呼び出し::GCC C++コンパイラ G ++ 3671 –