Installing the Perl package
Downloading ActivePerl for Windows
You can find the binary of ActivePerl 5.6.1 for Windows at:
http://www.activestate.com/Products/Download/Get.plex?id=ActivePerl [
direct link]. The file is 8.6 MB, and is distributed as an MSI package.
Installing ActivePerl
Start the installer, and then click through it (hopefully reading the prompts
along the way) until you get to a screen that looks like the one below.
![[Linked Image]](https://ubbdev.com/server/perl_01.png)
I
highly advise that you install Perl to a directory similar
to mine, which is
H:usr (yours needs to be whatever drive you have
Apache installed on, i.e.
C:usr or
D:usr). This is quite
helpful if you also have a Unix or Linux Web server, because then the Perl
path (the first line of any Perl file, usually
#!/usr/bin/perl)
will remain the same no matter what. Look at the screen below to see what
I mean regarding installation paths.
![[Linked Image]](https://ubbdev.com/server/perl_02.png)
Continue to set up Perl until you get to the screen below, for which you should
make your options the same as mine.
![[Linked Image]](https://ubbdev.com/server/perl_03.png)
Finish the installation by following the rest of the prompts, then continue
on to the next section when you're done.
Testing the Perl installation
Create a new blank document in
Notepad, and then copy and paste
the code below into the file.
#!/usr/bin/perl
print "Hello, World";
Save the file as
C:hello.pl. Start up the
Command Prompt and wait until you see
C:>. Type
perl hello.pl,
hit
Enter, and you should see
Hello, World. If you
see this, this means that Perl was installed successfully!
Allowing Perl to run freely
Back in your
httpd.conf file, search for
ScriptAlias /cgi-bin/
"H:/apache/cgi-bin/" and change it to
#ScriptAlias
/cgi-bin/ "H:/apache/cgi-bin/". Now find
#AddHandler cgi-script .cgi and change it to
AddHandler
cgi-script .cgi .pl. What we've done here is allowed Perl to run from
any directory, and also for files with the extension
.pl to be treated
as Perl files (which they should be!).
You'll need to restart Apache for these new changes to take
effect (see the previous page for information on how to restart Apache).
Testing Web-based Perl
Create a new blank document in
Notepad, and then copy and paste
the code below into the file.
#!/usr/bin/perl
print "Content-type:text/htmlnn";
print "Hello, World";
Save the file as
H:httpdocshello.cgi and then go to
http://127.0.0.1/hello.cgi in your browser to test that it works. If you see what I see (screen shot
below), give yourself a pat on the back!
Page 3:
Manually installing the PHP package