LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Apache Perl Problem.. (https://www.linuxquestions.org/questions/linux-software-2/apache-perl-problem-304642/)

chazzy 03-22-2005 06:38 AM

Apache Perl Problem..
 
Hi there,

I have a product which is designed for windows (it installs apache + modperl) and runs itself as a server.

I have compiled apache and mod_perl on slackware linux, everything works except the user login. This throws up the following error in error_log.

[Tue Mar 22 12:24:01 2005] [error] (2)No such file or directory: exec of /usr/local/apache/htdocs/champs/champscgi/users.cgi failed
[Tue Mar 22 12:24:01 2005] [error] [client 10.12.113.55] Premature end of script headers: /usr/local/apache/htdocs/champs/champscgi/users.cgi


Any ideas? - The file DOES exist.

Here is the top of the file itself.

Code:

#!perl -w
print "Content-type: text/plain\n\n";

$var = $ENV{'QUERY_STRING'};

#$len = length($var);

#Pickup the user name

$u=index($var,"username=");
$u1=$u + 9;
$u2=index($var,"&",$u1);
$u3=$u2-$u1;
$usr=lc(substr($var,$u1,$u3));
#print ("User $usr");

Thank you in advance!

stickman 03-22-2005 08:39 AM

Is that first line of your script the proper path to your Perl binary? Typically this is something like "/usr/bin/perl".

codeguy 03-22-2005 12:10 PM

You also need to make sure the script has execute rights... like chmod a+x users.cgi (this gives everyone execute rights -- probably a security risk)

I'm not sure, but I thought someplace I heard that dos line endings (CR LF) could cause problems, you can try switching to just unix line endings (just CR I think, but dont recall exactly)

-Andy


All times are GMT -5. The time now is 04:57 PM.