View Full Version : How should I use FastCGI for my perl script?
corleone
09-22-2009, 10:03 AM
I am using perl Catalyst module to create my website.
To make the response fast, I am thinking to use FastCGI.
BUT I am not familier with it.
How should I get started?
JamesYap
10-03-2009, 02:56 AM
If I understand it correctly, FASTCGI is for PHP and not for perl! (I might be wrong)
felgall
10-03-2009, 12:23 PM
Both PERL and PHP use CGI.
riot82
10-05-2009, 03:40 PM
Almost anything can run on Bluehost's servers using fastcgi. I don't have any experience using Python on them (I imagine that it would work), but I know for a fact that PHP, Perl, and Ruby on Rails all work through it.
In order to get Perl scripts using fastcgi there are a couple of things that you want to do. The first (and the extension you choose will depend on your needs) step would be to add the following line to your .htaccess file:
AddHandler fcgid-script .pl
This will help process your Perl scripts through fastcgi.
Next, you will need to code your application in a fascgi friendly manner. Here is an example:
#!/usr/bin/perl
use FCGI;
$count = 0;
while (FCGI::accept >= 0) {
print "Content-type: text/html\r\n\r\n";
$count++;
print "This will only count up if you are running under fastcgi: $count\n";
}
Hopefully this helps you out.
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.