You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Aaron Axelsen <ax...@amadmax.com> on 2002/11/17 00:40:47 UTC

[users@httpd] CGI Not working

I installed apache 2.0.43 and whenever I try to run a script I get the
following errors:

[Sat Nov 16 17:45:57 2002] [error] [client 192.168.0.100] Premature end
of script headers: classevals3.pl

I have run this script on other systems, so it must be something
specific to my system

---
Aaron Axelsen
AIM: AAAK2
Email: axelseaa@amadmax.com
URL: www.amadmax.com
 
"It said, ""Insert disk #3,"" but only two will fit!"
"One picture is worth 128K words."



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


RE: [users@httpd] CGI Not working

Posted by Aaron Axelsen <ax...@amadmax.com>.
Retyping the path to perl seemed to fix the problem.. Thanks for the
help

---
Aaron Axelsen
AIM: AAAK2
Email: axelseaa@amadmax.com
URL: www.amadmax.com
 
"It said, ""Insert disk #3,"" but only two will fit!"
"One picture is worth 128K words."


-----Original Message-----
From: Joshua Slive [mailto:joshua@slive.ca] 
Sent: Saturday, November 16, 2002 6:36 PM
To: users@httpd.apache.org
Subject: RE: [users@httpd] CGI Not working



On Sat, 16 Nov 2002, Aaron Axelsen wrote:

> ./classevals3 returns:
> : bad interpreter: No such file or directory
>
> Perl classevals3 returns correct data

There you go.  The shell can't find the interpreter listed on the first
line of the script.  Is perl really at /usr/bin/perl on that system?  If
it is, you should try deleting the first line and retyping it to fix any
problem with non-printable characters.  (Again, these are exactly the
two things I suggested could be wrong in my first email; I guess you
didn't follow my exact advice on how to test, but instead invoked perl
directly.)

Joshua.


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


RE: [users@httpd] CGI Not working

Posted by Joshua Slive <jo...@slive.ca>.
On Sat, 16 Nov 2002, Aaron Axelsen wrote:

> ./classevals3 returns:
> : bad interpreter: No such file or directory
>
> Perl classevals3 returns correct data

There you go.  The shell can't find the interpreter listed on the first
line of the script.  Is perl really at /usr/bin/perl on that system?  If
it is, you should try deleting the first line and retyping it to fix any
problem with non-printable characters.  (Again, these are exactly the two
things I suggested could be wrong in my first email; I guess you didn't
follow my exact advice on how to test, but instead invoked perl directly.)

Joshua.


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


RE: [users@httpd] CGI Not working

Posted by Aaron Axelsen <ax...@amadmax.com>.
./classevals3 returns:
: bad interpreter: No such file or directory

Perl classevals3 returns correct data

---
Aaron Axelsen
AIM: AAAK2
Email: axelseaa@amadmax.com
URL: www.amadmax.com
 
"It said, ""Insert disk #3,"" but only two will fit!"
"One picture is worth 128K words."


-----Original Message-----
From: Joshua Slive [mailto:joshua@slive.ca] 
Sent: Saturday, November 16, 2002 6:27 PM
To: users@httpd.apache.org
Subject: RE: [users@httpd] CGI Not working



On Sat, 16 Nov 2002, Aaron Axelsen wrote:

> I still don't understand why my classevals3 script runs on the machine

> it was created on, but does not run on mine.  The file can be 
> downloaded at http://alpha.frozenpc.net/classevals3.pl

There can be many many explanations: different environment, different
perl setup, etc.  Very few of them are directly related to Apache.

What EXACTLY is the result when you run
./classevals3.pl from the command line?

Joshua.


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


RE: [users@httpd] CGI Not working

Posted by Joshua Slive <jo...@slive.ca>.
On Sat, 16 Nov 2002, Aaron Axelsen wrote:

> I still don't understand why my classevals3 script runs on the machine
> it was created on, but does not run on mine.  The file can be downloaded
> at http://alpha.frozenpc.net/classevals3.pl

There can be many many explanations: different environment, different perl
setup, etc.  Very few of them are directly related to Apache.

What EXACTLY is the result when you run
./classevals3.pl from the command line?

Joshua.


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


RE: [users@httpd] CGI Not working

Posted by Aaron Axelsen <ax...@amadmax.com>.
I still don't understand why my classevals3 script runs on the machine
it was created on, but does not run on mine.  The file can be downloaded
at http://alpha.frozenpc.net/classevals3.pl





---
Aaron Axelsen
AIM: AAAK2
Email: axelseaa@amadmax.com
URL: www.amadmax.com
 
"It said, ""Insert disk #3,"" but only two will fit!"
"One picture is worth 128K words."


-----Original Message-----
From: Joshua Slive [mailto:joshua@slive.ca] 
Sent: Saturday, November 16, 2002 6:09 PM
To: users@httpd.apache.org
Subject: RE: [users@httpd] CGI Not working



On Sat, 16 Nov 2002, Aaron Axelsen wrote:

> Scripts run find from command line.  I changed the owner to nobody, 
> now

Not a good idea; Making it world-executable is usually better.

> I get the following error:
>
> [Sat Nov 16 18:04:43 2002] [error] [client 192.168.0.100] malformed 
> header from script. Bad header=6: test.pl
>
> I really don't see what the problem is

The script is now running, but it is not emitting proper HTTP headers.
According to the CGI spec, the first that that the CGI writes to stdout
must be a set of HTTP headers, followed by a blank line.  Your script is
not sending proper headers.  Instead, it is sending a line that looks
like
"6: test.pl".

Joshua.


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


RE: [users@httpd] CGI Not working

Posted by Joshua Slive <jo...@slive.ca>.
On Sat, 16 Nov 2002, Aaron Axelsen wrote:

> Scripts run find from command line.  I changed the owner to nobody, now

Not a good idea; Making it world-executable is usually better.

> I get the following error:
>
> [Sat Nov 16 18:04:43 2002] [error] [client 192.168.0.100] malformed
> header from script. Bad header=6: test.pl
>
> I really don't see what the problem is

The script is now running, but it is not emitting proper HTTP headers.
According to the CGI spec, the first that that the CGI writes to stdout
must be a set of HTTP headers, followed by a blank line.  Your script is
not sending proper headers.  Instead, it is sending a line that looks like
"6: test.pl".

Joshua.


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


RE: [users@httpd] CGI Not working

Posted by Aaron Axelsen <ax...@amadmax.com>.
Scripts run find from command line.  I changed the owner to nobody, now
I get the following error:

[Sat Nov 16 18:04:43 2002] [error] [client 192.168.0.100] malformed
header from script. Bad header=6: test.pl

I really don't see what the problem is

---
Aaron Axelsen
AIM: AAAK2
Email: axelseaa@amadmax.com
URL: www.amadmax.com
 
"It said, ""Insert disk #3,"" but only two will fit!"
"One picture is worth 128K words."


-----Original Message-----
From: Joshua Slive [mailto:joshua@slive.ca] 
Sent: Saturday, November 16, 2002 5:49 PM
To: users@httpd.apache.org
Subject: Re: [users@httpd] CGI Not working





On Sat, 16 Nov 2002, Aaron Axelsen wrote:

> I installed apache 2.0.43 and whenever I try to run a script I get the

> following errors:
>
> [Sat Nov 16 17:45:57 2002] [error] [client 192.168.0.100] Premature 
> end of script headers: classevals3.pl
>
> I have run this script on other systems, so it must be something 
> specific to my system

Go to the directory containing classevals3.pl and type ./classevals3.pl
Most likely, this will fail, which means something is wrong with the
script.  Some likely culprits:
- Not pointing to the correct location for perl on the first line.
- Bad dos->unix transfer, resulting in messed-up line-endings.

If the script succeeds from the command line, the most likely
explanation is an suexec config problem.  Find and read your suexec log
file.

See also:
http://httpd.apache.org/docs/misc/FAQ.html#premature-script-headers
http://httpd.apache.org/docs-2.0/howto/cgi.html#troubleshoot

Joshua.


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


Re: [users@httpd] CGI Not working

Posted by Joshua Slive <jo...@slive.ca>.


On Sat, 16 Nov 2002, Aaron Axelsen wrote:

> I installed apache 2.0.43 and whenever I try to run a script I get the
> following errors:
>
> [Sat Nov 16 17:45:57 2002] [error] [client 192.168.0.100] Premature end
> of script headers: classevals3.pl
>
> I have run this script on other systems, so it must be something
> specific to my system

Go to the directory containing classevals3.pl and type
./classevals3.pl
Most likely, this will fail, which means something is wrong with the
script.  Some likely culprits:
- Not pointing to the correct location for perl on the first line.
- Bad dos->unix transfer, resulting in messed-up line-endings.

If the script succeeds from the command line, the most likely explanation
is an suexec config problem.  Find and read your suexec log file.

See also:
http://httpd.apache.org/docs/misc/FAQ.html#premature-script-headers
http://httpd.apache.org/docs-2.0/howto/cgi.html#troubleshoot

Joshua.


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