httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gabriel" <gabesdura...@yahoo.com.br>
Subject Re: [users@httpd] Premature end of script headers
Date Sat, 26 Apr 2003 17:00:01 GMT
But  I compile the code on server machine and put it on the folder /cgi-bin/
and it suppose to run automaticly. This code is not Perl.


----- Original Message -----
From: "Jeff Cohen" <support@gej-it.com>
To: <users@httpd.apache.org>
Sent: Saturday, April 26, 2003 1:19 PM
Subject: RE: [users@httpd] Premature end of script headers


You are missing the shebang line at the beginning of the script.
It should look something like that:
#!/usr/perl/bin/perl
if you are using *nix system.
If you are running on win32 system:
#!c:\perl\bin\perl.exe

You must "tell" the script where is the application to run it from is
located.
Just change the path to where perl.exe is located.

All the best,
Jeff Cohen

-----Original Message-----
From: Gabriel [mailto:gabesdurante@yahoo.com.br]
Sent: Saturday, April 26, 2003 12:13 PM
To: users@httpd.apache.org
Subject: [users@httpd] Premature end of script headers

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

Gabriel Durante


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