[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cobalt-security] Script Error



The 'premature end of script headers' message is unlikely to show up in
a browser unless you've set the Carp module to spit errors out to the
browser.

You get that error message in your httpd error log. Look at the lines
preceding the line you are quoting, as that will tell you what's wrong.

If your script is dying for some reason (whatever reason) the entries
will be there, like so:

Illegal division by zero at /home/cgi-bin/graph2.cgi line 99.
[Tue Aug  1 11:05:32 2000] [error] [client blah.blah] Premature end of
script headers: /home/httpd/cgi-bin/graph2.cgi

So I made a goof in that one by feeding a zero value into the
denominator part of a division operation. Duh ;)

You could end up with hundreds of lines per error - read the top one
first, it usually indicates where the problem starts. A good idea whilst
debugging is to (a) print things to STDERR (they then appear in the
httpd error log too) at various points, and (b) run:

[user@machine] tail -f /var/log/httpd/error_log

then try running your script. That way you get realtime feedback.

Hope this helps.

Best Wishes,

Graeme Fowler
Systems Administrator
graeme.f@xxxxxxxxxxxxxxx

***************************************************************
WebFusion Internet Solutions Ltd.
The UK's Largest Web Hosting Company
http://www.webfusion.co.uk
***************************************************************
----- Original Message -----
From: Kevin D <kdlists@xxxxxxxxxxxxxxx>
To: <cobalt-security@xxxxxxxxxxxxxxx>
Sent: Monday, August 07, 2000 2:15 PM
Subject: Re: [cobalt-security] Script Error


> This probably belongs on the cobalt developers list, not here, but....
>
> Sometimes this error occurs when a CGI script executes and returns
nothing.
> All CGI scripts have to return something to the browser/client.
>
> I don't think you'd see this error by calling modules that don't
exist...
> more likely you'd see the ubiquitous "Internal Server Error" (from the
> browser) or some type of file not found error (from the command line).
>
> Kevin
>
> ----- Original Message -----
> From: "Sean Bierdrager" <sean@xxxxxxxxxxxx>
> To: <cobalt-security@xxxxxxxxxxxxxxx>
> Sent: Sunday, August 06, 2000 10:58 PM
> Subject: [cobalt-security] Script Error
>
>
> > What EXACTLY does premature end of script headers mean and how do
you get
> > rid of it?  I'm assuming that in perl scripts which call perl
modules that
> > don't exist gives this error... am I right?  Please help this newbie
;)
> >
> > Sean Bierdrager
> >
> >
> > _______________________________________________
> > cobalt-security mailing list
> > cobalt-security@xxxxxxxxxxxxxxx
> > http://list.cobalt.com/mailman/listinfo/cobalt-security
> >
>
>
> _______________________________________________
> cobalt-security mailing list
> cobalt-security@xxxxxxxxxxxxxxx
> http://list.cobalt.com/mailman/listinfo/cobalt-security