Download the lastest version of ActivePerl from:
(if it asks you to register, you can just leave the form blank and hit “Continue”).
Get the Windows (x86) MSI version. My file was named:
I highly recommend that you install perl to a directory like:
[Check] Add Perl to the PATH environment variable
[Check] Create Perl file extension association
The rest should be grayed out and read-only, but if not, leave them unchecked
3. Activating CGI
Using any text editor open
httpd.conf (should be start-menu shortcut “
Apache HTTP Server 2.2 > Configure Apache Server > Edit the Apache httpd.conf Configuration File“).
ExecCGI to the end
Options Indexes FollowSymLinks (about line 190).
Options Indexes FollowSymLinks ExecCGI
4. Enabling CGI in any directory
You will need to uncomment the following line and I also added
.cgi so ‘perl’ extension is also treated as cgi files.
AddHandler cgi-script .cgi .pl
If you will be creating your own cgi-bin, you will want to comment out as following lilne:
#ScriptAlias /cgi-bin/ "C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/"
5. Finding your location to perl
If you do not know where your perl.exe installed to, go to Start ->Search and type in a search for perl.exe This location is the path to perl you put on the top of all your cgi scripts. If you listened to my advice in the “Install” step, the path should be close to:
6. Testing CGI
Create a file in your DocumentRoot called hello.cgi and put three lines in it:
print "hello world";
Restart Apache if it is already running. Now go to
http://localhost/cgi-bin/hello.cgi (or wherever you put the file) and run the script.
7. If you get a hello world in your browser, CGI is running.
If you get a 500 error, go to the last entry in Apache error log (Apache HTTP Server 2.2 > Review Server Log Files > Review Error Log shortcut in the Start Menu) to see exactly what caused this error.