You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Gabriel <ga...@yahoo.com.br> on 2003/04/27 17:35:44 UTC

[users@httpd] Run CGI

I install Apache 2.0 on Windows 98 Plataform and I try to run a CGI  that was writen in C on it, but browser always shows me this error "Internal server error" and log error file shows "premature end of script headers". The code is in cgi-bin folder and the httpd.conf is with default parameters.
the code is that:
--------------------------------------------------------------------------------------------------------------
#include <stdio.h>

void main()
{
 printf("Content-type: text/html\n\n\n");
 printf("<TITLE>Home Page do Gabriel</TITLE>\n");
 printf("<HTML>\n");
 printf("<BODY>\n");
 printf("<CENTER><H1>HELLO WORLD</H1></CENTER>\n");
 printf("</BODY>\n");
 printf("</HTML>");

}
-----------------------------------------------------------------------------------------------------------------
 The code me that:
-----------------------------------------------------------------------------------------------------------------
Content-type: text/html


<TITLE>Home Page do Gabriel</TITLE>
<HTML>
<BODY>
<CENTER><H1>HELLO WORLD</H1></CENTER>
</BODY>
</HTML>
------------------------------------------------------------------------------------------------------------------
I think the code is right but I''m not sure if the httpd.conf is OK. What can I do?

Regards.

Gabriel Durante

Re: [users@httpd] Run CGI

Posted by Chris Knipe <sa...@savage.za.org>.
Just tested it on my FreeBSD system, and it works... 




--
me

  ----- Original Message ----- 
  From: Gabriel 
  To: users@httpd.apache.org 
  Sent: Sunday, April 27, 2003 5:35 PM
  Subject: [users@httpd] Run CGI


  I install Apache 2.0 on Windows 98 Plataform and I try to run a CGI  that was writen in C on it, but browser always shows me this error "Internal server error" and log error file shows "premature end of script headers". The code is in cgi-bin folder and the httpd.conf is with default parameters.
  the code is that:
  --------------------------------------------------------------------------------------------------------------
  #include <stdio.h>

  void main()
  {
   printf("Content-type: text/html\n\n\n");
   printf("<TITLE>Home Page do Gabriel</TITLE>\n");
   printf("<HTML>\n");
   printf("<BODY>\n");
   printf("<CENTER><H1>HELLO WORLD</H1></CENTER>\n");
   printf("</BODY>\n");
   printf("</HTML>");

  }
  -----------------------------------------------------------------------------------------------------------------
   The code me that:
  -----------------------------------------------------------------------------------------------------------------
  Content-type: text/html


  <TITLE>Home Page do Gabriel</TITLE>
  <HTML>
  <BODY>
  <CENTER><H1>HELLO WORLD</H1></CENTER>
  </BODY>
  </HTML>
  ------------------------------------------------------------------------------------------------------------------
  I think the code is right but I''m not sure if the httpd.conf is OK. What can I do?

  Regards.

  Gabriel Durante