I’m pulling out my hair getting Apache/Perl to work and would like some help with getting httpd.conf, Windows path, and other setting correct to run some Perl programs. I’ve set alias, Options, AddHandler, etc. but the simple program below gives permission errors. I’m running a Bitnami WampStack on XP and they have Perl.exe in a git/bin directory. I’ve copied and put it in \Windows. I get permission error saying something like 'don't have permission to access script on this page'. So I must need to set some kind of permissions for a directory or something. Also, not sure where to put scripts because I typically have php programs off htdocs in Apache, but cgi-bin directory is not below htdocs. Should I create a cgi-bin directory off htdocs? Otherwise, I don't understand how to address it as localhost = the htdocs directory.

Thanks in advance for any thoughts/suggestions.

Below are the instructions I'm following from EditRocket on running Perl.


Directions I’ve been following from EditRocket

Configuring Perl CGI in Apache
The next step is to use EditRocket to open the httpd.conf apache configuration file located in the apache install directory in the conf directory. Search the httpd.conf file for the line

Options Indexes FollowSymLinks

Add ExecCGI to this line. The line should now look like the following:

Options Indexes FollowSymLinks ExecCGI

Next, search for the following:

AddHandler cgi-script .cgi

Uncomment this line by removing the # in front of the line, and add a .pl to the end of the line. The new line should look like this:

AddHandler cgi-script .cgi .pl

Now, the apache web server needs to be restarted. You can do this either via the Apache service located in the services control panel or via the Start -> All Programs -> Apache . . . -> Control Apache Server menu option. Once apache is restarted, you can run a test page to make sure everything is working correctly.
Running a test Perl CGI script
You can create a new Perl test page in EditRocket by selecting File - New From Template - Perl - Sample Web Page. This will bring up the following in a new editor tab:

print "Content-type: text/html; charset=iso-8859-1\n\n";
print "<phtml>";
print "<body>";
print "Test Page";
print "</body>";
print "</html>";

I am not sure I can help you (and may be too late). I have never set up Apache to run Perl on Windows. Anyway, if you could set up Apache to run, then you may need Perl CGI module to be installed as well. By default, the module may not be installed. On Linux, I simply download and install it in a command (aptitude or apt-get). Not sure how you install a module in Windows. Maybe you could use CPAN to install the module?

This article has been dead for over six months. Start a new discussion instead.