2

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!

Amir Rezvani
  • 9,447
  • 9
  • 37
  • 56

3 Answers3

4

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.

diavol
  • 271
  • 2
  • 7
3

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

Amir Rezvani
  • 9,447
  • 9
  • 37
  • 56
2

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).

Community
  • 1
  • 1
paulsm4
  • 99,714
  • 15
  • 125
  • 160
  • Thanks for your response, my hello world application works fine. I change the action of the form to be "helloWorld.pl" to test whether problem is with the MyScript.pl, but getting the same result :( – Amir Rezvani Jan 23 '12 at 03:42
  • Q: So you're saying: a) if you browse to "HelloWorld.pl", it works. You see the result of "echo 'Hello World'" in your browser, correct? b) You're also saying if you point the action for your form at the SAME "HelloWorld.pl" it gives you the same "HTTP 405 invalid method (HTTP verb)" error? That makes no sense :(... Please post your "HelloWorld.pl". – paulsm4 Jan 23 '12 at 05:05
  • thanks for your help. I found the solution, have posted it here. – Amir Rezvani Jan 23 '12 at 22:15