If you installed Apache on Windows (I like WAMPServer myself) and you’re trying to run Perl scripts, you might encounter the dreaded Internal Server Error (500) and a cryptic entry in Apache’s error log:
[Sat Jun 04 19:01:50 2011] [error] [client 127.0.0.1] (OS 2)The system cannot find the file specified. : couldn't create child process: 720002:
[Sat Jun 04 19:01:50 2011] [error] [client 127.0.0.1] (OS 2)The system cannot find the file specified. : couldn't spawn child process:
I realized I had installed ActivePerl to the wrong place, and Apache couldn’t find it (I was able to run my Perl scripts from the command line, just not from Apache). All my perl scripts start with #!/usr/local/bin/perl as the shebang line, since this is what my Linux servers all use. So on Windows, I always install ActivePerl to c:\usr\local and it works great. My earlier mistake was to install ActivePerl to c:\usr\local\perl. So by removing and reinstalling ActivePerl to the correct directory, I thought this would be solved.
Then I was getting:
[Sun Jun 05 07:29:24 2011] [error] [client 127.0.0.1] (OS 5)Access is denied. : couldn't create child process: 720005:
[Sun Jun 05 07:29:24 2011] [error] [client 127.0.0.1] (OS 5)Access is denied. : couldn't spawn child process:
Now I was scratching my head. Access denied? Turns out, even though I had uninstalled and reinstalled ActivePerl to c:\usr\local, there was still a “perl” folder inside c:\usr\local\bin from the earlier installation of ActivePerl. Of course my scripts are looking for \usr\local\bin\perl – so they are finding the FOLDER called “perl” rather than the executable, perl.exe. You can’t execute a folder, hence the access denied error. Once I deleted the erroneous folder, the shebang lines in my scripts directed Apache to the perl executable and my script started working immediately.
So, if you are seeing this error, look very closely at your shebang lines and where they point to. In my case, uninstalling ActivePerl did not fully remove the prior directory structure and that caused problems even when I later reinstalled it to the correct place.
4 replies on “Apache: “couldn’t create child process: 720005””
Thanks!…my problems exactly…
Thanks, this solved my problem as well. I am running python and I had to change my shebang line on windows 7 to: #!C:/usr/bin/python/python (it was #!C:/usr/bin/python and that did not work, as you said – that was trying to access the folder python name, and so for my use case, I needed to reference to the python.exe inside that folder by adding an additional python).
Thank you so much Mr. Hausman!
You helped me solving the mystery!
I have XAMPP running under Win7 and Perl results installed by default since I got the 1.8.0 version of XAMPP.
My .pl files were not working. I used to get a server error: “… couldn’t create child process: 720005: …”
My mistake was that I didn’t “envelop” the path name in quotation marks and also I didn’t put “\perl.exe” at the and of it.
So, in my case, the first line had to be:
#!”C:\xampp\perl\bin\perl.exe”
in order to work.
And it works now!
Thank you again.
Hey claude i was having the same problem but resolved now thanks to you. I am using strawberry perl and my shebang line is:
#!”C:\strawberry\perl\bin\perl.exe”
And everything works now. Thanks again for posting this.