Over a million developers have joined DZone.

FastCGI Test Script

DZone's Guide to

FastCGI Test Script

· ·
Free Resource
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.


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"); }

Opinions expressed by DZone contributors are their own.

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

{{ parent.tldr }}

{{ parent.urlSource.name }}