(OS 3) The system cannot find the path specified
Recently, I got a new computer and I had to install the Apache Web Server on a Windows platform to be able to test my CGI scripts locally before publishing them on the internet. The installation went well and I could test CGI executables without problems, but HTML pages that used Perl scripts displayed the dreaded HTTP Status 500 - Internal Server Error. My Apache error.log file had the entry:
[client 127.0.0.1] (OS 3)The system cannot find the path specified.
: couldn't create child process: 720003: echo1.pl
This type of error occurs more frequently in Windows systems than in Linux or Unix systems. The reason is that the shebang line of the Perl script (#!/usr/bin/perl) is used by the Apache web server to find a program to interpret the script. In Windows systems, the Perl interpreter is normally installed as C:\Perl\bin\perl.exe, whereas in Linux/Unix systems the path is usually /usr/bin/perl, as indicated in the shebang line. Although there are several ways of telling the web server where to find the Perl interpreter, I have found that the simplest solution is to leave the Apache configuration alone and store a copy of the Perl interpreter as C:\usr\bin\perl.exe.
In this way, I can test my Perl scripts in the Windows system with exactly the same code that will run in the Linux systems. In the event that I upgrade to a new version of Perl, I have to remember to also change the copy in the local C:\usr\bin\ directory, or install the new version of Perl in directory C:\usr instead of the default directory C:\perl.
© Copyright - Antonio Zamora