#include "/usr/local/include/fcgi_stdio.h"
#include <string.h>
#include <stdlib.h>
int main(int argc,char *argv[])
{
char *method;
while(FCGI_Accept() >= 0){
method = getenv("REQUEST_METHOD");
printf("Content-Type:text/plain\n\n");
//printf("hello fastcgi\n");
printf("%s\n",method);
}
return 0;
}
gcc -o hello hello.c -L/usr/local/lib -lfcgi
spawn-fcgi -a127.0.0.1 -p 9001 -n ./hello