httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Jobes" <djo...@xscanners.org>
Subject RE: [users@httpd] Premature end of script headers
Date Sat, 26 Apr 2003 17:11:46 GMT
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" <jdweiss@chanweiss.com>
To: <users@httpd.apache.org>
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 <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 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 <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



---------------------------------------------------------------------
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