Over a million developers have joined DZone.

FastCGI Test Script

·
If you're having trouble with FastCGI (as I was), this Perl script can help you see if the problem is at the Apache end or the app end. In my case I'd simply not deleted the old Ruby sessions for my Rails app when switching from CGI to FCGI ;-) This script proved my Apache wasn't broken, at least.

#!/usr/bin/perl

use FCGI;

$cnt = 0;

while (FCGI::accept() >= 0)
{
   print ("Content-type: text/html\r\n\r\n");
   print ("\nFastCGI Demo Page (perl)\n\n");
   print  ("

FastCGI Demo Page (perl)

\n"); print ("This is coming from a FastCGI server.\n
\n"); print ("Running on $ENV{USER} to $ENV{REMOTE_HOST}\n
\n"); $cnt++; print ("This is connection number $cnt\n"); }
Topics:

Opinions expressed by DZone contributors are their own.

The best of DZone straight to your inbox.

SEE AN EXAMPLE
Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.
Subscribe

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}