From: Sir G. <sir...@gm...> - 2006-12-25 09:04:51
|
Hi, I am making some trys with BOA and CGI programs (in C). There is any especial configuracion to ejecute the CGI file. Always says me: 502 Bad GatewayThe CGI was not CGI/1.1 compliant. The CGI is very simple (is a try): #include <stdio.h> #include <stdlib.h> #include <cgivargs.h> #define DATAFILE "data.txt" int main(void) { FILE *f = fopen(DATAFILE,"r"); int ch; printf("%s%c%c\n","Content-Type:text/html;charset=iso-8859-1",13,10); if(f == NULL) { printf("<TITLE>Failure</TITLE>\n"); printf("<P><EM>Unable to open data file, sorry!</EM>"); } else { while((ch=getc(f)) != EOF) putchar(ch); fclose(f); } return 0; } and the cgi file have the chmod attributes.... (chmod a+x) Any Idea? Regards, Sir Graham, |