I have had Brian Ingersons Kwiki installed and running for sometime. I use it for notes etc. it has proved very useful and works very well.
But today I discovered that my Kwiki was not responding in the expected way:
[Tue Apr 27 09:02:28 2004] [error] [client 127.0.0.1] Premature end of script headers: /Users/jonasbn/Sites/NotesWiki/index.cgi
Googling for Premature end of... is not especially useful.
All the Perl scripts associated with the Wiki compiled and it actually returned HTML when run on the commandline. So the bug had to be in the Apache configuration. So I had a look at the httpd.conf, but it also seem pretty ok, a simple helloworld test in the same directory worked ok - so I located Kwiki::CGI and had a looked at it - apparently this line made all the trouble...
my $cgi_class = (eval { require CGI::Fast; 1 } ? 'CGI::Fast' : 'CGI');I have had FastCGI installed for some testing, but I do not use it anymore, but apparently it is used over CGI, when found in @INC
That's the most basic of all Apache errors, so I wouldn't expect that it would be.
Which brings me to my point: it might return HTML on the command-line, but does it begin with a header ("Content-type: text/html" almost certainly) and a blank space before beginning the HTML?
Of course, differences in the environment between your account and the web server user could also account for the difference.
-Matt