Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Method Not Allowed

( #38291=categorized question: print w/ replies, xml ) Need Help??
Contributed by moath on Oct 25, 2000 at 08:31 UTC
Q&A  > CGI programming


Description:

I've got a script that SHOULD accept input from a form using the POST method. However, I keep getting "Method Not Allowed" error. The error code is 405. Is this just a misconfiguration in Apache, or is there something wrong with my script. The script is a big large to post, but what can you tell from what I've said thus far?

Answer: Method Not Allowed
contributed by extremely

Sounds like Apache to me. It is a straight CGI I assume and not a mod_perl Registry script. I'd bet on a line like

<Location />
  <Limit POST PUT DELETE>
  Deny all
  </Limit>
</Location>
in your config...
Answer: Method Not Allowed
contributed by Fastolfe

This sounds like your script is not in a directory recognized by your web server as a CGI directory (such as /cgi-bin/). If you're attempting to put Perl scripts anywhere in your document hierarchy, be certain your web server is set up to handle files of that extension as a CGI script. For example, with Apache, place this in the relevant <Directory> or <Location> blocks, or if you don't care to localize the effect, anywhere else will do:

AddHandler cgi-script .pl
The problem stems from the fact that your script may be being interpreted as a plain document, which cannot be POSTed to. You have to tell the server to interpret that file as a CGI script instead of a document, which involves placing it in a directory set up for CGI scripts, or telling the server that documents with that extension/MIME type should be treated as CGI scripts.
Answer: Method Not Allowed
contributed by AgentM

Take one step at a time- test a bland CGI like this:

use CGI qw/:standard/; print '<html><head><body>hi';
Then you're SURE to find out where the error is (since it's not in the bland CGI).

Please (register and) log in if you wish to add an answer



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • Outside of code tags, you may need to use entities for some characters:
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others drinking their drinks and smoking their pipes about the Monastery: (14)
    As of 2014-09-30 12:49 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      How do you remember the number of days in each month?











      Results (368 votes), past polls