[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1113
  • Last Modified:

405 - Method Not Allowed


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.
  • 3
  • 2
2 Solutions
Julian MatzCommented:
HTML files cannot receive POST requests. It needs to be an be a page which uses server-side scripting, like php, asp, asp.net, perl.

What exactly do you mean by
"if I rename it to "index.php" I can't see  as PHP file" ?
jackgroAuthor Commented:
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 ?
Julian MatzCommented:
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: http://example.com/test.php
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...
Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

jackgroAuthor Commented:
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 ?
Did you follow the notes shipping with php, esp. no. 14. and below?

Julian MatzCommented:
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 :)

Featured Post

Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now