Notes for running CGI scripts on Windows Apache Server

From http://www.thesitewizard.com/archive/addcgitoapache.shtml

Need to modify your CGI script to make it run. As it stands, if your CGI script is a Windows executable, it would be executed by Apache correctly. However, if it's a script that relies on an interpreter such as Perl or Python, you will have to modify the first line of the script.

Your Perl script will typically contain an initial line of

#!/usr/bin/perl


or some such thing. This tells a Unix-based kernel to look for an interpreter at the path "/usr/bin/perl" and invoke it to interpret the instructions in the file.

Since the script now runs on Windows, and it is unlikely that you installed your Perl interpreter in a /usr/bin directory, you will need to change that first line to point to the real location of your Perl interpreter.

For example, on my Windows box, I have to change the first line of my Perl scripts to:


#!c:/program files/perl/bin/perl.exe

Of course if you are using other scripting languages, you will have to set that initial line to point to whatever interpreter you are using.

没有评论:

发表评论