Getting apache server error 500 when trying to run perl script

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:

Server error!
The server encountered an internal error and was unable to complete your request.

Error message:
couldn't create child process: 720003: copy.cgi

If you think this is a server error, please contact the webmaster.

Error 500

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:

#!C:\apche2triad\perl\bin\perl.exe
use CGI::Carp qw (fatalsToBrowser);
use File::Copy;

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.  
grizzly_adamsAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

clockwatcherCommented:
Is this really the path to your perl?

#!C:\apche2triad\perl\bin\perl.exe

Or are you missing an 'a' in there?
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
grizzly_adamsAuthor Commented:
Well it looks like I simply left out the 'a' on apache lol.  I can't believe I missed that one.  Now all I get is a simple error telling me "software error: could not copy".  So I guess this problem was really a simple one.  Thanks alot clockwatcher.
0
TintinCommented:
Make sure you change

copy($filetobecopied, $newfile) or die"Could not copy $filetobecopied.";

to

copy($filetobecopied, $newfile) or die"Could not copy $filetobecopied $!\n";

$! will contain the OS reason why the copy failed.  Probably due to permissions.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Apache Web Server

From novice to tech pro — start learning today.