• How To Install Perl on a WAMP Server

    Step 1:

    Download and install WAMP server (WampServer), default installation is c:\wamp. Installing WampServer is not in the scope of this, “how to”. You can read my article on WAMP vs. IIS for a better understanding of WAMP.

    Step 2:

    Download and install Active Perl from http://www.activestate.com/activeperl/downloads/ ; based on this tutorial, download the Windows Installer (MSI). Run the installer;

    • Click Next on the first screen, “Using ActivePerl at work?”.
    • Read and accept license agreement, hit next.
    • Custom setup screen, choose browse and install it in c:\wamp\bin\Perl\. click next, and keep all the following defaults, and finally install it. It will take some time to install depending on your computer.
    • And finally once installed, uncheck, Display the release notes, and click finish.

    I chose the installation directory c:\wamp\bin\Perl\, to keep consistency for all apache related applications.

    Step 3:

    Verify the installer actually wrote the PATH variable in your system. This will save you a lot of headaches. Right click on “My Computer”, select properties, select Advanced Properties, click on Environmental Variables and under System variables scroll down and double click on PATH and verify c:\wamp\bin\Perl\site\bin; is in the Variable value.

    Or simply open a command prompt, start> run> cmd> and type:

    prompt>perl -v

    It should spit out the version of the perl your running.

    Step 4:

    Configure httpd.conf on WAMP server (WampServer) for perl. Open C:\wamp\bin\apache\Apache2.2.11\conf\httpd.conf, file which is your apache configuration file.

    • Look for, Directory “c:/wamp/www/”, and under this line look for and replace:
      Options Indexes FollowSymLinks

      with:

      Options Indexes FollowSymLinks Includes ExecCGI

      This will activate Perl for your WAMP server (WampServer), so you can run Perl scripts.

    • Look for and replace:
      #AddHandler cgi-script .cgi

      with:

      AddHandler cgi-script .cgi
      AddHandler cgi-script .pl

      This will activate the AddHandler for cgi and pl. These are common, so enable them.

    • Look for and replace:
      DirectoryIndex index.php index.php3 index.html index.htm

      with:

      DirectoryIndex index.php index.php3 index.html index.htm index.cgi index.pl

      Apache executes these in the respective order; if it doesn’t find index.php it will look for index.php3 than index.html and so on.

    Step 5:

    Restart WAMP server (WampServer) apache service. Wampserver > Apache > Service > Restart Service. Your server is ready to run, Perl. You can test by downloading this file and placing into one of your development site, c:/wamp/www/dev-site.com/perl-stuff, and executing it via browser, i.e. http://dev-site.com/perl-stuff.

    Configuring your WAMP server (WampServer) to run a development site is not in the scope of this, “how to”.

    This entry was posted on Saturday, February 13th, 2010 at 4:08 pm and is filed under How To, Web Dev. You can follow any responses to this entry through the RSS 2.0 feed. You can skip to the end and leave a response. Pinging is currently not allowed.
  • 7 Comments

    Take a look at some of the responses we've had to this article.

    1. " Install Perl on WAMP "

      Johnston
      Posted on March 20th

      I installed it in another directory, but when I typed perl -v, it said “Perl is not recognized as an internal or external command, operable program or batch file” I checked the system variables,
      E:\server\wamp\bin\Perl\site\bin;
      E:\server\wamp\bin\Perl\bin
      But doesn’t work. Any Ideas?

    2. " Install Perl on WAMP "

      CJ
      Posted on March 26th

      Johnston
      Have you tried rebooting?

    3. " Install Perl on WAMP "

      Perless
      Posted on November 25th

      Hey CJ, great article! One issue though. I have no problem with the perl -v, but I cannot open *.pl files (created *.pl files in www/new/)

      I receive 500 Internal Server Errors

      I’ve restarted WAMP and even restarted the system and then started WAMP.

      httpd is updated according to your instructions.

      Any ideas?

      Thanks!

    4. " Install Perl on WAMP "

      dimitris
      Posted on January 26th

      You have to add in path :
      c:\wamp\bin\Perl\bin, not include “site”
      This worked fine for me - thanks

    5. " Install Perl on WAMP "

      vikrant
      Posted on March 18th

      @dimitris: “You have to add in path :
      c:\wamp\bin\Perl\bin, not include “site”
      This worked fine for me - thanks”
      wat does this mean?

    6. " Install Perl on WAMP "

      mac
      Posted on April 12th

      Hi everything working fine fir me. But when I open perl.pl in my browser it says “Forbidden” You don’t have permission to access /peexam.pl on this server. plzz help

    7. " Install Perl on WAMP "

      Posted on May 13th

      Same for me, I can’t execute .pl files the code is showing up in browser when I try it.

  • Post a Comment

    Let us know what you thought.

  • Name:

    Email:

    Website:

    Message: