405 - Method Not Allowed

Posted on 2006-05-24
Last Modified: 2010-03-04

I have got a problem with a form.
Something like as: The requested method POST is not allowed for the URL...

It's on "index.html" file and if I rename it to "index.php" I can't see  as PHP file, how I can fix it in httpd.conf ?
I mean allow PHP for my website.
Question by:jackgro
    LVL 21

    Expert Comment

    by:Julian Matz
    HTML files cannot receive POST requests. It needs to be an be a page which uses server-side scripting, like php, asp,, perl.

    What exactly do you mean by
    "if I rename it to "index.php" I can't see  as PHP file" ?

    Author Comment

    Yes, I understand you.
    My right problem is that it's not working as PHP, I can see the code when I open the webpage, so I think it's not working.
    How I can just put it working ?
    LVL 21

    Accepted Solution

    If you can see the actual PHP code in your browser, then it could be that you do not have PHP installed on your server.

    Try this:

    Open a blank text file and paste this code into it:
    <?php echo "This is a test..."; ?>

    Then rename the file to "test.php" and upload it to your server.

    Then open the page from your browser:
    and see what happens.

    If you can see only "This is a test..." then PHP is installed and working. If you see the whole code, or if the browser asks if you'd like to download the file, then PHP is either not installed or the mime-type configuraton isn't right...

    Author Comment

    I can see the code when I tried it.
    I believe that maybe the problem is there're not right mime-type configuraton.
    How I can fix mime-type configuraton to put PHP working ?
    LVL 27

    Assisted Solution

    Did you follow the notes shipping with php, esp. no. 14. and below?
    LVL 21

    Expert Comment

    by:Julian Matz
    Well, I'm not the best person to ask about this, but... you could check /etc/mime.types to see if php is specified there, and also try looking in /etc/httpd/httpd.conf for something like:
    AddType application/x-httpd-php .php .php3 .php5 .php4 .phtml

    If you have Apache2, the path may be different, and I believe the config files are structured a little differently also...

    Hopefully caterham_www will be able to take over now, he is more of an expert in this TA than I am :)

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Should I Do With This Threat Intelligence?

    Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

    Introduction As you’re probably aware the HTTP protocol offers basic / weak authentication, which in combination with the relevant configuration on your web server, provides the ability to password protect all or part of your host.  If you were not…
    If you've heard about htaccess and it sounds like it does what you want, but you're not sure how it works... well, you're in the right place. Read on. Some Basics #1. It's a file and its filename is .htaccess (yes, with a dot in the front). #…
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    9 Experts available now in Live!

    Get 1:1 Help Now