httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robert Andersson" <rob...@profundis.nu>
Subject Re: [users@httpd] Premature end of script headers
Date Fri, 13 Jun 2003 04:17:12 GMT
Charlie Smith wrote:
> Internal Server errors quite often deal with permissions.

Yes, but not in this case. The OP stated that the error log said 'Premature
end of script headers', which is either that the interpreter wasn't found or
that the script/executable itself didn't send the appropriate headers. He
also stated in another e-mail that he was using Windows 98, where
permissions don't even exist.


Regards,
Robert Andersson


----- Original Message -----
From: "Charlie Smith" <SmithCW@ldschurch.org>
To: <users@httpd.apache.org>; <robert@profundis.nu>
Sent: Thursday, June 12, 2003 10:14 PM
Subject: Re: [users@httpd] Premature end of script headers


> Internal Server errors quite often deal with permissions.  The routine
needs to be visible and executable by your apache user account.
>
> >>> robert@profundis.nu 06/11/03 10:09PM >>>
> In ancient times (April 26, 2003 ;-) Gabriel wrote:
>
> > Hi,
> >
> > I'm tring to run my first CGI in C language. Of course it's Hello World.
> > The code is that:
> >
> > #include <stdio.h>
> >
> > int main()
> > {
> > printf("Content-type: text/html\n\n");
> > printf("<HTML>\n");
> > printf("<BODY>\n");
> > printf("<CENTER><H1>HELLO WORLD</H1></CENTER>\n");
> > printf("</BODY>\n");
> > printf("</HTML>");
> >
> > return 0;
> > }
> >
> > when I try to run it the browser shows INTERNAL SERVER ERROR
> > And the error log file shows Premature end of script headers
>
> I doubt that Gabriel is still on this, but I saw no reply that commented
on
> what struck me first, so for the archives sake.
>
> The problem is likely the new-lines. "\n" compiles to ASCII 10 = 0x0a.
But,
> the HTTP protocol defines new-line as <CRLF> => ASCII 13 + 10 = 0x0d +
0x0a.
>
> Therefor, the first line should be:
>
>     printf("Content-type: test/html\r\n\r\n");
>
>
> Regards,
> Robert Andersson
>
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>
>
>
> --------------------------------------------------------------------------
----
> This message may contain confidential information, and is intended only
for the use of the individual(s) to whom it is addressed.
>
>
>
============================================================================
==
>
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message