Return-Path: Delivered-To: apmail-httpd-users-archive@httpd.apache.org Received: (qmail 41145 invoked by uid 500); 26 Apr 2003 17:12:30 -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 41131 invoked from network); 26 Apr 2003 17:12:29 -0000 Received: from commons10k1.mo24.107.113.38.charter-stl.com (HELO mail.xscanners.org) (24.107.113.38) by daedalus.apache.org with SMTP; 26 Apr 2003 17:12:29 -0000 Received: from localhost.xscanners.org (localhost.xscanners.org [127.0.0.1]) by mail.xscanners.org (xscanners.org) with ESMTP id 6C85411007 for ; Sat, 26 Apr 2003 12:19:41 -0500 (CDT) Received: from devel (unknown [192.168.1.133]) by mail.xscanners.org (xscanners.org) with SMTP id 7CD0011007 for ; Sat, 26 Apr 2003 12:19:36 -0500 (CDT) From: "David Jobes" To: Date: Sat, 26 Apr 2003 12:11:46 -0500 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 In-Reply-To: <003f01c30c15$84a5a2c0$d0a7fea9@durante> X-AntiVirus: checked by Vexira MailArmor (version: 2.0.1.7; VAE: 6.19.0.3; VDF: 6.19.0.9; host: mail.xscanners.org) X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Subject: RE: [users@httpd] Premature end of script headers gcc -o helloworld.cgi helloworld.c -------------------------------------- David Jobes - CISSP Web: http://www.xscanners.org yahooid: davidjobes31770 aimid: aggrogade email: djobes@xscanners.org -----Original Message----- From: Gabriel [mailto:gabesdurante@yahoo.com.br] Sent: Saturday, April 26, 2003 12:02 PM To: users@httpd.apache.org Subject: Re: [users@httpd] Premature end of script headers How can I compile it to run as a script? ----- Original Message ----- From: "Jeremy D. Weiss" To: Sent: Saturday, April 26, 2003 1:33 PM Subject: Re: [users@httpd] Premature end of script headers > At 01:12 PM 04/26/2003 -0300, you 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 think the code is ok. > >What can I do to fix that problem? > > One of the things I usually do when I encounter problems with a cgi is to > try running it independently, from a command prompt. You don't explicitly > state it anywhere, but I'm assuming you compiled the program into a binary, > and were not trying to run the C code as a script (since, AFAIK, Apache can > not run uncompiled C code). > > ==Jeremy > > > > --------------------------------------------------------------------- > 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 --------------------------------------------------------------------- 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 --------------------------------------------------------------------- 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