09-10-2009, 11:14 AM
Join Date: Dec 2008
Gzip output script works with Perl-CGI but gives error with Perl-FCGI..
I was trying to install popular perl based forum YaBB on a Litespeed installation. It worked well when I was running Perl in CGI mode but started giving blank pages when I switched to FCGI using lsperld. After some debugging I found out that its the GZIP code which is causing this and wrote a simple script to reproduce the error:
This script works fine and outputs "Hello World." correctly in browser in CGI mode. But when switching to FCGI, it shows all blank and I can see "gzip: stdout: Bad file descriptor" in stderr.log
$output = "Hello World.";
open(GZIP, "| gzip -f");
$| = 1;
print "Content-Encoding: gzip\nContent-type: text/html\n\n";
print GZIP $output;
Is there anyway to rectify this?