On Friday, April 26, 2002, at 06:48 , Alex Swavely wrote:
> I can't get this cgi script I downloaded to run...
>
> the line in the apache log says:
>
> $ tail -2 /var/log/apache/error.log
> [Fri Apr 26 18:40:55 2002] [error] (2)No such file or directory: exec of
> /usr/lib/cgi-bin/agbot/agbot.cgi failed
> [Fri Apr 26 18:40:55 2002] [error] [client 192.168.7.98] Premature end
> of
> script headers: /usr/lib/cgi-bin/agbot/agbot.cgi
[..]
> That looks ok, so then I:
>
> $ head -1 /usr/lib/cgi-bin/agbot/agbot.cgi
> #!/usr/bin/perl
> $ which perl
> /usr/bin/perl
>
> Hmm, that looks right...
but is where you miss the critical data
try
od -c /usr/lib/cgi-bin/agbot/agbot.cgi | head -5
you will most likely find that this is a 'dos' style file
with the "\r\n" problem
Had the author done the kosher thing with
#!/usr/bin/perl -w
then what looks like a "^M" in vi would have been hanging
off the '-w' and not off the perl.
> So I try to run it:
>
> $ /usr/lib/cgi-bin/agbot/agbot.cgi
> bash: /usr/lib/cgi-bin/agbot/agbot.cgi: No such file or directory
the expected results since the shebang is trying to find
/usr/bin/perl^M
and that does not exist....
cf man dos2unix
ciao
drieux
---
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]