IIS 405 HTTP verb used to access this page is not allowed email

Chris picture Chris · Oct 24, 2012 · Viewed 55.6k times · Source

First off, I'm familiar with IIS however do not have much practical experience, hence why I have come here.

I have setup IIS7 and put my HTML website, scripts etc into the wwwroot folder. I'm able to browse the website locally just for testing purposes.

I have a webpage with a simple email form which uses Matt's Script Archive: FormMail.pl. Upon submission, I run into this error:

 405 - HTTP verb used to access this page is not allowed.
 The page you are looking for cannot be displayed because an invalid method (HTTP verb) was used to attempt access.

I'm not sure about this error or how to resolve it so the email form works.

If you need any additional information regarding this problem, I'll provide as much info as possible.

Thanks :)

Update:

Ok, so I have modified my HTML to use the nms script. In IIS I had to enable CGI and ISAPI as they weren't installed. Once they were installed I added a Script Handler Mapping for *.pl, *cgi; also added the Verbs GET, HEAD, and POST to both of the Handler Mappings. I than used:

 <!DOCTYPE htmlPUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml" lang="en-US" xml:lang="en-US">
 <head>
 <title>Perl Test</title>
 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
 </head>
 <body>
 <h1>Perl is working!</h1>
 </body>
 </html>

To test if the *.pl and *.cgi is working on the localhost.

Now comes the part where I'm stuck...

When I click on the submit button it directs me to the formmail.cgi (formmail.pl doesn't work for some reason) however it only directs me to the cgi script, and a blank, white page.

Answer

Desislav Kamenov picture Desislav Kamenov · Oct 24, 2012

405 means that your Web Server is not recognizing the HTTP metod(GET,POST,HEAD etc.) in the request. In your case I think that .pl extensions are not allowed by default to handle POST requests. Please refer to this link (taken from here) for creating Handler Mappings.