Return-Path: Delivered-To: apmail-httpd-users-archive@httpd.apache.org Received: (qmail 41010 invoked by uid 500); 12 Jun 2003 20:16:25 -0000 Mailing-List: contact users-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: users@httpd.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list users@httpd.apache.org Received: (qmail 40827 invoked from network); 12 Jun 2003 20:16:23 -0000 Received: from mail2.gmhwh.org (HELO mail.gmhwh.org) (12.110.19.38) by daedalus.apache.org with SMTP; 12 Jun 2003 20:16:23 -0000 X-Server-Uuid: 1ea73c7c-c7d8-11d5-bae0-0002a564cf8c Message-ID: Date: Thu, 12 Jun 2003 14:14:56 -0600 From: "Charlie Smith" To: users@httpd.apache.org, robert@profundis.nu MIME-Version: 1.0 X-WSS-ID: 12F600C852221-01-02 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Content-Disposition: inline X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Subject: Re: [users@httpd] Premature end of script headers Internal Server errors quite often deal with permissions. The routine need= s= 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 > > int main() > { > printf("Content-type: text/html\n\n"); > printf("\n"); > printf("\n"); > printf("

HELLO WORLD

\n"); > printf("\n"); > printf(""); > > 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 =3D 0x0a. = But, the HTTP protocol defines new-line as =3D> ASCII 13 + 10 =3D 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 for more info. To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org=20 " from the digest: users-digest-unsubscribe@httpd.apache.org=20 =46or additional commands, e-mail: users-help@httpd.apache.org=20 ---------------------------------------------------------------------------= --- This message may contain confidential information, and is intended only for= = the use of the individual(s) to whom it is addressed. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --------------------------------------------------------------------- The official User-To-User support forum of the Apache HTTP Server Project. See 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