Click to See Complete Forum and Search --> : perl scripts on apache


jman_77
02-19-2001, 04:31 AM
alright, so, I'm having this incredible problem with perl scripts on my server. Running scripts from a browser returns "internal server error". so I log onto the server and check the logs. "no such file or directory: exec of /blah/script.cgi failed". So, I go to the directory and type "perl script.cgi" and it runs. However, typing "./script.cgi" Returns "No such file or directory" again.
Someone has suggested that this may be a problem with the system being unable to locate perl, but I have no idea why this may be.
please help
thank you
-Josh rose

osnap
02-20-2001, 12:12 AM
Is the file executable? Try 'chmod'ing it executable with 'chmod +x script.cgi' and see if it works.

Or, do a 'whereis perl' to find where perl is and then change the first line in the script to point to it, i.e. '#!/usr/bin/perl'

jman_77
02-20-2001, 04:20 AM
mmm. Indeed. I've checked those both out, and it's all groovy, but it's still not working. :(
all the files are properly chmodded and the path to perl is correct. So, I'm stumped. again.
:confused:

osnap
02-20-2001, 02:16 PM
It the script in the cgi-bin? On some servers you can only use cgis in the cgi-bin, if it is outside of this then it won't work.

jman_77
02-20-2001, 03:57 PM
yeah. It's my server, beautiful little thing when it works. I'm worried that I have the scriptalias set up wrong somehow, even though it all looks right :-\
ah well...

YaRness
02-20-2001, 04:29 PM
seems like you may have checked this, but i'll mention it anyway... if it's something you can finagle into running from the command line, do that and make sure it's doing what it's supposed to; that's how i usually figure out what the problem is with a web script.

XxMaCaBrExX
02-23-2001, 04:51 PM
ok type "which perl" then open up the script and add in the full path to perl on the first line. It's obviously a broken path to perl, becuase if you tell perl to run it, there's no problem, but when you tell the shell to run it, and it can't find the perl interpreter, it says, "No such file or Directory", meaning the perl executable. You Follow Me? :D