httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Scott Miller" <>
Subject Re: [users@httpd] Premature end of script headers
Date Thu, 23 Feb 2006 19:47:38 GMT
>> Fedora Core 4
>> Apache 2.0.54
>> I seem to be having this same problem.  I read the manual at:
>> and created the "" file.  when I run "./" from the 
>> command
>> line, all it prints is:
>> Content-type: text/html
>> and does not print the "Hello, World." at all.
>> And in my browser - it gives me the "Internal Server Error"
>> All it says in my error logs is:
>> [Thu Feb 23 08:55:35 2006] [error] [client xx.xx.xx.xx] Premature end of 
>> script headers:
>> If anyone could point me in the direction where I need to look, it would 
>> be
>> greatly appriciated
> It sounds a lot like you are missing the empty line that terminates
> the header.    This is the 'header' that initiates the transfer and
> precedes the <html><head>... stuff.   It is usually sent for you when
> the server reads and sends out a .html file.    But if you are running
> a script or binary that is creating the content, you have to take care
> of that little detail.
> You need to start with a line something like:
>  Content-type: text/html\n\n
> eg.  in Perl, for example a print for the first of the data sent
>    would look like:
>  print "Content-type: text/html\n\n";
> ////jerry

That's exactly what I have - here's the file:

print "Content-type: text/html\n\n";
print "Hello, World.";

Also - I guess ie does work via command line as shown:

[root@serv7 cgi-bin]# ./
Content-type: text/html

Hello, World.[root@serv7 cgi-bin]#

Just "missed" it since it was on the same line - I then added a couple \n\n 
to it, and it prints nicely.

However, it does not display anything vai the browser - just the "Internal 
Server Error"

[Thu Feb 23 12:45:35 2006] [error] [client xx.xx.xx.xx] Premature end of 
script headers:

Thanks for the help.

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

View raw message