in reply to Apache/CGI error: "Premature end of script headers"

I'd get away from the Perl part for a second, and try basic CGI functions:
#!/bin/sh echo content-type: text/plain echo date
Put this somewhere, and if you don't get the date every time you reload, your problem clearly isn't Perl.

Your shebang line also looks weirdly weird as well. Are you sure that's the path to Perl?

-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.

Replies are listed 'Best First'.
Re: •Re: Apache/CGI error: "Premature end of script headers"
by Callum (Chaplain) on May 18, 2004 at 15:01 UTC
    I've tried something similar in order to confirm what was being seen with the the error handling scripts as I wasn't certain that they would be being invoked in the same way as general CGI, to verify the user it was running as and that it was running each time -- each time I run the datetest.cgi bourne shell script it displays the date and writes it to a file (as the user it's supposed to be running as).

    As for the path to perl,

    (bin)% /WWW/bin/perl -ver This is perl, v5.6.1 built for sun4-solaris Copyright 1987-2001...
    that, plus that it runs the scripts when executed on the command line, makes me pretty sure it's perl :)

    We have a web-server specific perl installation which is only used by the webserver.