Handling Perl IIS 7.5

2019-07-11 14:21发布

I've got a project written in classic asp, and a particular form's submit is handled by a Perl script.

I'm going to do an enhancement for this project. I installed the latest version of ActivePerl for Windows 32 bits.

I looked at the production environment and saw that in the IIS 7.5, there is an entry on "Handler Mappings" for *.pl to be handled by C:\Perl\bin\PerlEx30.dll. So I did the same thing on development environment. (please note that there is no mapping for "*.cgi" on the Prod. environment)

Now when I'm trying to submit the form which its action is MyScript.pl, I get the following error:

HTTP Error 405.0 - Method Not Allowed
The page you are looking for cannot be displayed because an invalid method (HTTP verb) is being used.

Maybe worth saying that, I'm on 64 bits environment, I tried ActivePerl for Windows 64 bits as well (I mapped *.pl to perl514.dll) but still getting the same error!

3条回答
forever°为你锁心
2楼-- · 2019-07-11 14:34

The application pool was set so "Enable 32-Bit Applications = false", I change it to true, and it fixes the issue.

查看更多
我想做一个坏孩纸
3楼-- · 2019-07-11 14:39

Your workaround was to use 32-bit version of perl. If you want to use the 64-bit version, this worked for me on IIS 8.5 Windows 2012 R2:

  1. Add Module Mapping to your site:
  2. Request path: *.pl
  3. Module: CgiModule
  4. Executable: C:\Perl64\bin\perl.exe "%s" %s
  5. Name: Perl CGI

You can test it by creating the following 'hello world' page:

use strict;
use CGI;

my $page = new CGI;
my $msg = "Hello from ActivePerl CGI!";

print $page->header( "text/html" ),$page->start_html( $msg );
print $page->h2($msg);
print $page->end_html;

Name it something like test.pl, drop it into your webroot directory and browse to it to test.

查看更多
何必那么认真
4楼-- · 2019-07-11 14:51

You haven't said whether or not you've gotten ANY Perl to work yet (even a "hello world"), or if the problem is this one particular script (perhaps just on this one particular server).

ANYWAY -

  1. I doubt your Perl install is the problem.

  2. You definitely need to do more troubleshooting.

  3. I'd start with verifying whether a simple, one-line "hello world" will work.

  4. Next, I'd "divide and conquer" to determine exactly WHERE the problem is. I'm guessing it's very probably somewhere in "MyScript.pl". I'm also guessing that it should be fairly easy to track down.

  5. These links might help give you more clues as to exactly what you might look for as you "divide and conquer" (AFTER you've verified that Perl itself can be invoked from your IIS):

PS: I'm guessing the problem might be as simple as a missing, or inappropriate, URL in "MyScript.pl"!

PPS: At the risk of repeating myself - please verify "helo_world.pl" first. If it doesn't work, please post the complete "hello_world" script and the complete error message(s).

查看更多
登录 后发表回答