Getting apache server error 500 when trying to run perl script
Posted on 2007-04-05
Ok to start with, I am using apache2triad on a windows server 2003 web edition os. It has apache 2.2.0 and perl 5.8.7 in it. The first problem I was having is that anytime I would try to execute a perl script from a web browser, it would try to download the file. I went to the apache2triad control panel and tried to run the mod_perl test, and it also wants to download the file instead of executing it. So thenI changed the extension on my perl script from .pl to .cgi. As soon as I did this, I got this message:
The server encountered an internal error and was unable to complete your request.
couldn't create child process: 720003: copy.cgi
If you think this is a server error, please contact the webmaster.
When I looked at the error log for apache, I found this:
[Thu Apr 05 14:45:23 2007] [error] [client 172.16.90.137] (OS 3)The system cannot find the path specified. : couldn't spawn child process: C:/apache2triad/htdocs/revolve/copy.cgi
It looks to me like it is having a problem with the directory I gave it. Also, I can run my perl script just fine outside of apache. It will copy the file over just like it is supposed to. It only has a problem when I try to access it from my browser. This is my perl script:
use CGI::Carp qw (fatalsToBrowser);
print "content-type: text/html \n\n"; #The header
$filetobecopied = "c:/testfile.txt.";
$newfile = "z:/testfilemoved.txt.";
copy($filetobecopied, $newfile) or die"Could not copy $filetobecopied.";
I have been stuck with this for a few days now and I cannot seem to find anyone that knows what is going on. Any help would greatly be appreciated.