httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jeff Cohen" <>
Subject RE: [users@httpd] Premature end of script headers
Date Sat, 26 Apr 2003 16:19:12 GMT
You are missing the shebang line at the beginning of the script.
It should look something like that:
if you are using *nix system.
If you are running on win32 system:

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

All the best,
Jeff Cohen

-----Original Message-----
From: Gabriel [] 
Sent: Saturday, April 26, 2003 12:13 PM
Subject: [users@httpd] Premature end of script headers

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("<CENTER><H1>HELLO WORLD</H1></CENTER>\n");
 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? 
Gabriel Durante

The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message