Web Extensions and Applications Using FastCGI
By Scott Dybiec and Philip Rousselle
Dr. Dobb's Journal June 1997
<B>(a)</B> #include <time.h> main() { time_t tod; printf("Content-type: text/html\r\n"); printf("\r\n"); time(&tod); printf("The current time of day is <b>%</b>s <BR>", ctime(&tod)); } <B>(b)</B> #include <time.h> #include <fcgi_stdio.h> main() { time_t tod; while(FCGI_Accept() >= 0) { printf("Content-type: text/html\r\n"); printf("\r\n"); time(&tod); printf("The current time of day is <b>%</b>s <BR>", ctime(&tod)); } exit(0); } <B>(c)</B> AppClass /server-root/fcgi-executables/tod.fcgi <B>(d) </B> <Directory /server-root/fcgi-executables> AddType application/x-httpd/x-httpd-fcgi .fcgi </Directory>
Example 1: Converting CGI to FastCGI.
Copyright © 1997, Dr. Dobb's Journal