How to enable PERL in Wampserver 2.0
by mr. H8ers13th
Mar
2008
This is how I enabled PERL in Wampserver 2.0.
Before I begin, here is my computer information: Windows XP service pack 2, Wampserver 2.0.
I first downloaded PERL from active Perl. Then I opened my wamp “www” directory and added a file called cgi-bin.
Now untar your your PERL tarball and open up the folder called Perl that was just made. Open up the folder called ActivePerl-5.8.8.822-MSWin32-x86-280952. Click on Installer your will now be in a command prompt window. When given the option “[c:\Perl]“, type in “C:\wamp\bin\perl”, this keeps the PERL language separated just like the PHP, Apache, and MySQL.
Now the fun stuff. Open up your apache httpd.conf file by clicking the wampser icon located in your windows task-bar going to Apache and clicking the httpd.conf icon. Look for
<Directory "cgi-bin">
AllowOverride None
Options None
Order allow,deny
Allow from all
</Directory>Now change this to
<Directory "C:/wamp/www/cgi-bin">
AllowOverride None
Options ExecCGI
Order allow,deny
Allow from all
</Directory>
Now go down and find ” <IfModule mime_module>” you should see “#AddHandler cgi-script .cgi” uncomment this, i.e. remove “#”, and change to “AddHandler cgi-script .pl”. When you do make perl scripts you will have to use “#!c:\wamp\bin\perl\bin\perl.exe” to call the PERL scripting engine. You could even add index.pl to your Directory indexes, but they would probably only work in your file cgi-bin.
I hope this helps you out. Please remember I only use Wampserver as a testing server never online and I do not think this is the clean way of doing it, but it works for me.
Tags: PERL, Wampserver


March 13th, 2008 at 10:24 pm
[...] Read the rest of this great post here [...]
March 13th, 2008 at 11:33 pm
[...] Read the rest of this great post here [...]
July 2nd, 2008 at 1:54 pm
Nice article….cept i cant quite get it to work.
It keeps giving me a forbidden message for anything ending in .pl
and if i try and goto my cgi-bin directory
July 2nd, 2008 at 11:43 pm
To tell you the truth I haven’t used wampserver in quite some time, I am suprised that they haven’t made a module for perl yet. You might want to consult a Perl forum, But from what your comment says it seems that you are having a mime type issue. You might get lucky with “AddHandler cgi-script .cgi .pl” and you might want to add index.pl to your index lists in the httpd.conf file
#!/usr/bin/perl #comment: the real path to perl like the one above in the article
# comment:your httpd.conf should have something like this:
# Alias /perl/ /real/path/to/perl-scripts/
#
# SetHandler perl-script
# PerlHandler Apache::Registry
# PerlSendHeader On
# Options +ExecCGI
#
try the above but un-comment the the non comments.
December 8th, 2009 at 2:38 pm
Just a couple of things to add from my experiences:
1. The default wampserver mandates placing scripts in:
C:\wamp\bin\apache\Apache2.2.11\cgi-bin
and not:
c:\wamp\www\cgi-bin
as I expected.
I have a problem with IE8 as it offers:
“Do you want to open or save the file”
when I run a Perl script. However, Firefox runs the script AOK. I have not had time to check out why IE8 settings are causing this.
December 8th, 2009 at 3:08 pm
@Paul Carden: freaky, I just put windows xp on a virtualbox and installed wampserver on it in arch linux, basically because paint.Net make’s gimp look like, well, a gimp. It doesn’t really mater where you put the cgi bin as long as it is configured in your httpd.conf also if. I haven’t used windows in over a year. I’m going to have to install perl and python now I’ll let you know what I come up with and probably add another article.