Willman023 has asked for the wisdom of the Perl Monks concerning the following question:

Fellow Monks, I'm trying to learn/incorporate Fast::CGI for my website. I tried a simple Hello World, and one of the example scripts, and I'm getting Internal Webserver Errors. My webhost supposedly supports fast CGI, and they run perl 5.6.1. Any ideas on how I can troubleshoot further?
Thanks

#!/usr/local/bin/perl use strict; use CGI::Fast qw(:standard); $COUNTER = 0; while (new CGI::Fast) { print header; print start_html("Fast CGI Rocks"); print h1("Fast CGI Rocks"), "Invocation number ",b($COUNTER++), " PID ",b($$),".", hr; print end_html; } AND #!/usr/local/bin/perl use strict; use CGI::Fast; while (new CGI::Fast) { my $query = new CGI; print $query->header ( ); print "Fast CGI Rocks!\n"; }
bW
Perl = Software Engineer's Swiss Army Knife

Replies are listed 'Best First'.
Re: CGI::Fast Getting Started
by perrin (Chancellor) on Mar 16, 2003 at 22:12 UTC
    If your webhost supports FastCGI, they should have very specific instructions on how to use it. It is not as simple as just using the CGI::Fast module. The requirements are determined by the web server configuration that they use.
(z) Re: CGI::Fast Getting Started
by zigdon (Deacon) on Mar 18, 2003 at 21:34 UTC

    You could always tell us what's in the error log when you get this error - that should give everyone a clue.

    Or, you could add a

    use CGI::Carp qw/fatalsToBrowser/;
    if you don't have access to the error log.

    -- zigdon

      Thanks zigdon, but even when I use fatalsToBrowser it doesn't give me an error...just 500 Internal Server Error. In the log though, I have "Premature end of script headers"
      My webhost hasn't gotten back to me yet either.

      bW
      Perl - the breakfast of Champions!

        In that case, I'd guess you have compilation errors. Can you do a 'perl -cT script.pl' on a commandline somewhere?

        -- zigdon