httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gary Turner <>
Subject Re: [users@httpd] cgi's are working just 2 times
Date Mon, 03 Mar 2003 01:33:49 GMT
Stefan Lischke wrote:

>I added a Script Alias to one VirtualHost, but the CGI's are working only 2
>After that i always get a 500 "Premature....". When i restart Apache2, it
>works again for 2 times.
>I can start the Perl's or the C Exec. from commandline without any problem
>has anybody seen such a problem or can someone imagine what it can be.

STFW.  Google is your friend.

This is from the first of nearly 10,000 hits.

|What it means is that the script has a problem when
|Causes are  : 
|1) bad code 
|        EG - in perl each staement must be ended with a semicolon
|        So if I had this line in perl : 
|                print "Hello World"
|        I would get a premature end of script header because it needs to
|        print "Hello World";
|2) A resource that the script needs it can't find.
|        EG - again a perl example
|                use CGI;
|        I'd get that error if I didn't have the CGI perl module
|3) permissions - it has to be executable 
|Do to the directory that the cgi file is in and type ls -l.
|It should be something like -rwxr-xr-x ....
|If it's not executable by the user the web server is running as then
|your get the premature end of script headers.

The prime reason for this error is a bug in the script.

#1 is the likely culprit.  The fact that it runs twice w/o failure
suggests to me to look for a loop or counter or some such that does not
get reset (or at least something similar).  Since restarting Apache
resets, maybe some Apache variable is being modified (the value is
stepped beyond range?) and not returned to default.
 If someone tells you---
 "I have a sense of humor, but that's not funny." 
                                  ---they don't.

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