Method not allowed. Must be one of: POST (I am using LAMP)

April 5, 2016 8.8k views
LAMP Stack


First of all, let me tell you that this isn’t a 405 Method Not Allowed error. The message in the subject is the message I get when I try to access to my droplet from my browser. What is weird is that the POST request works when I send it from Chrome’s Advanced Rest Client Application…
Can someone please tell me how to solve this problem?

Thank you very much!

1 Answer

What software are you running on this server? Is this a static page you are trying to reach? If this is not a 405 error (which would indicate a configuration issue) I would recommend checking your apache error log to see if a script is encountering a problem, causing this message.

  • Thank you for your response.
    I am using PHP files and making RESTful calls based on Slim Framework.
    Where can I see the Apache error log?

    • It will be located in /var/log/apache2/error.log if you are on Ubuntu or Debian and /var/log/httpd/error.log if you are on CentOS or Fedora.

      • I am sorry I didn’t respond to your previous question: I am using Ubuntu.

        Actually, I found nothing about the not allowed POST method… It is very weird actually because I can do the request from the chrome rest client (the application in chrome extensions) but I cannot do it from my browser, and when I try to connect from Android Studio, the connection is refused…

        • When you attempt to access this from a browser are you doing it from a form request? Otherwise, simply adding the url and variables in the address bar will pass the data but will do so as a GET and not a POST request.

Have another answer? Share your knowledge.