[ LUGOS ] Apache 1.3.6 in perl cgi-bin skriptice - RESITEV
Jaka Mele
jack na lugos.si
Tor Jun 29 09:34:17 CEST 1999
On Tue, 29 Jun 1999, Jaka Mele wrote:
Ahh!
Kako zabaceni so ti apache FAQuji :)
Mimogrede - a se je tudi ostalim to pojavljalo? Ste tisti delcek dali v
skripto in potem dela?
lp, Jack
--
What does it mean when my CGIs fail with "Premature end of script
headers"?
It means just what it says: the server was expecting a complete set of
HTTP headers (one or more followed by a blank line), and didn't get them.
The most common cause of this problem is the script dying before sending
the complete set of headers, or possibly any at all, to the server. To see
if this is the case, try running the script standalone from an interactive
session, rather than as a script under the server. If you get error
messages, this is almost certainly the cause of the "premature end of
script headers" message.
The second most common cause of this (aside from people not outputting the
required headers at all) is a result of an interaction with Perl's output
buffering. To make Perl flush its buffers after each output statement,
insert the following statements around the print or write statements that
send your HTTP headers:
{
local ($oldbar) = $|;
$cfh = select (STDOUT);
$| = 1;
#
# print your HTTP headers here
#
$| = $oldbar;
select ($cfh);
}
This is generally only necessary when you are calling external programs
from your script that send output to stdout, or if there will be a long
delay between the time the headers are sent and the actual content starts
being emitted. To maximize performance, you should turn buffer-flushing
back off (with $| = 0 or the equivalent) after the statements that send
the headers, as displayed above.
If your script isn't written in Perl, do the equivalent thing for whatever
language you are using (e.g., for C, call fflush() after writing the
headers).
Another cause for the "premature end of script headers" message are the
RLimitCPU and RLimitMEM directives. You may get the message if the CGI
script was killed due to a resource limit.
--------------------------------------------------------------------------------
>
> Zivjo
>
> Odkar sem upgradal na apache 1.3.6 iz 1.1.nekaj, mi perl skripte ne
> delujejo. Sever vsakic javi :
>
> ------------
> Internal Server Error The server encountered an internal error or
> misconfiguration and was unable to complete your request. Please contact
> the server administrator, webmaster na lugos.si and inform them of the time
> the error occurred, and anything you might have done that may have caused
> the error.
> More information about this error may be available in the server error
> log.
> --------------------------------------------------------------------------------
> Apache/1.3.6 Server at www.zrsss.si Port 80
>
> V logih pa je tole:
>
> [Tue Jun 29 09:17:11 1999] [error] [client 194.249.7.14] Premature end of
> script headers: /opt/www/cgi-bin/jack.cgi
> [Tue Jun 29 09:17:12 1999] [error] [client 194.249.7.14] Premature end of
> script headers: /opt/www/cgi-bin/jack.cgi
> [Tue Jun 29 09:17:39 1999] [error] [client 194.249.7.14] Premature end of
> script headers: /opt/www/cgi-bin/jack.cgi
> We'r in MaxDigits
> We'r in MaxDigits
> [Tue Jun 29 09:20:58 1999] [error] (8)Exec format error: exec of
> /opt/www/cgi-bin/Date.pl failed
> [Tue Jun 29 09:20:58 1999] [error] [client 194.249.7.14] Premature end of
> script headers: /opt/www/cgi-bin/Date.pl
> [Tue Jun 29 09:21:01 1999] [error] (8)Exec format error: exec of
> /opt/www/cgi-bin/Date.pl failed
> [Tue Jun 29 09:21:01 1999] [error] [client 194.249.7.14] Premature end of
> script headers: /opt/www/cgi-bin/Date.pl
> ro:/opt/www/logs#
>
> Vse poti do perl programa so delujoce, skripte so prej delovale, zdaj ne -
> niso nic sprememnjene... Kaksne ideje? Mimogrede - se zmeraj mi ni jasno
> kaj je tudi tisti "we's in maxdigits" :) Kr neki!
>
> lp, Jaka
>
>
lp, Jaka
Dodatne informacije o seznamu Starilist