httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Owen Boyle <>
Subject Re: cgi problems
Date Mon, 21 Jan 2002 08:30:16 GMT
Tim B wrote:
> Hello again,
>  Ok I am running Linux Mandrake 8.0 and running
> Apache 1.3.19.
> I am trying to get cgi to work on the system. I
> keep getting a 500 error. Here is what is in
> the error_log
> malformed header from script. Bad
> header=Content-type text/html: /var/www/cgi-
> bin/test.cgi
> can someone tell me what this means please? I
> am a newbie so please in english <grin>

When a server (i.e. apache) sends a document to a client (i.e. a
browser) it has to precede the data with a "header" - this is a short
message which tells the client what type of data is coming next (text,
image, sound - whatever). This is so the client can decide how to render

According to RFC2068 which governs HTTP, the header should look like:

message-header = field-name ":" [ field-value ] CRLF

Compare this with what you've got and you see you're missing the ":"

Change your script to:

print "Content-type: text/html\n\n";

and it should work.


Owen Boyle.

The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message