Kwiki Trouble

jonasbn on 2004-04-27T17:36:29

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

I forced $cgi_class to 'CGI' and now it works again... I do not completely understand why it works on the commandline, but the force to 'CGI' does the job.

I have reported the trouble (I do not think it is a bug) using rt.cpan.org and I have written this journal entry in case others run into the same problem...


Premature end of script headers

mattriffle on 2004-04-27T19:43:30

> Googling for Premature end of... is not especially useful.

That's the most basic of all Apache errors, so I wouldn't expect that it would be. :) All it means is that the script didn't begin its output with a Content-type header.

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