'Hello World' in Perl and CFastCGI is a high-performance API supported by the Zeus Web Server. It is an open standard, and is language and platform independent. FastCGI provides both authorization and content generation services, and has a simple, quick development cycle. FastCGI is recommended as a general purpose solution for almost any task. Hello World in PerlHere is a simple example of a hello world program for FastCGI written in Perl. Additionally you will need to first install the FastCGI Perl module. At the time of writing, the latest version is available at http://www.cpan.org/modules/by-module/FCGI/FCGI-0.67.tar.gz Ensure the FastCGI module is enabled, and the path mapping module is set up correctly so that your FastCGI programs can be run.
#!/usr/bin/perl
use FCGI;
while( FCGI::accept() >= 0 )
{
print( "Content-Type: text/plain", "\n\n" );
print( "Hello World in Perl", "\n" );
}
Hello World in CHere is a simple example of a hello world program for FastCGI written in C. Before you can compile this, you will need to install the FastCGI devkit. At the time of writing the latest version is available from http://www.fastcgi.com/dist/devkit_2.2.0.tar.gz
#include <fcgi_stdio.h>
int main( int argc, char *argv[] )
{
while( FCGI_Accept() >= 0 ) {
printf( "Content-Type: text/plain\n\n" );
printf( "Hello world in C\n" );
}
return 0;
}
On a Linux machine, a typical command to compile this would be along the lines of: gcc -o hello hello.c -lfcgi
Content Manager
[Administrator] 16 December 2005
|
Recent Articles
Other Resources
|


