Forum Moderators: phranque
Consultant:
This is my "FORM" html tag:
form method="post" action="process.php"
This is error:
Method Not Allowed
The requested method POST is not allowed for the URL /~example.com/directory/process.php.
Apache/1.3.27 Server at secure.example.com Port 443
Question is: Please, can you enable "POST" methods for PHP scripts? I think - it's .htaccess file.
I publish simple test:
1. source code:
<form method="post" action="simplest.php">
<input type="submit" value="Submit">
</form>
2. source code of "simplest.php" :
<? echo('POST request working');?>
3. I press button "Submit" and get error:
The requested method POST is not allowed for the URL /~example.com/directory/simplest.php
Host:
I renamed the .htaccess files for that directory and it's parent, though that made not difference unfortunately. Some more Tier II staff will be in today during our normal business hours to have a look at this.
We do not provide script support at this time. If you need help with using htaccess (it is supported by default in all web server configurations) try researching "htaccess" at [httpd.apache.org...]
How can I fix this issue? Thanks for any help!
<Sorry, no personal URLs. See TOS [webmasterworld.com]>
[edited by: tedster at 3:10 am (utc) on May 4, 2004]
<Limit> [httpd.apache.org]
<LimitExcept> [httpd.apache.org]
you can enable POST via <Limit> in htaccess I believe.
Make sure that the script and the form page are both in the same domain - For example, don't have the form in http://www.example.com/form and try to post to https://www.example.com/cart
Look for any redirect or script action that might be unintentionally doing this.
If they give you the "We don't support scripts" runaround, then make a simple.html form and ask them to support that. Actually, by pointing you to Apache, they show a level of awareness that's fairly good compared to most...
Jim
Simple test - here:
[205.214........]
Source code:
<form method="post" action="simplest.php">
<input type="submit" value="Submit">
</form>
Sure, "simplest.html" and "simplest.php" are in the same folder.
In total: at least 2 problems here.
1st problem: method "POST" disabled for secure server.
I mean - for non secure server "POST" method works:
[example.com...]
2nd problem: even for non-secure server "POST" method disabled for CGI scripts. I publish simplest test here:
[example.com...]
source code:
<form method="post" action="test_1.cgi">
<input type="submit" value="Submit">
</form>
Error is the same: "The requested method POST is not allowed".
I need help! :(
Thanks everyone.
I publish test for "mensedgehhc" site here:
[205.214.......] and get the same error (method POST is not allowed).
Hi Joe,
Unfortunately, troubleshooting scripts is outside of the realm of our support and not something our tech support team will have the expertise to assist you with. I would strongly advise working with someone that has specific experience in this area. If there are questions about the configuration of the server, here is complete documentation on what was done on your server:
A new domain, secure.example.com, was created and the SSL certificate for this domain installed.
A vhost.conf file was added to the /home/httpd/vhosts/secure.example.com/conf directory that contains the following:
<IfModule mod_userdir.c>
UserDir /home/httpd/vhosts/*/httpdocs
</IfModule>
What this does is override the default Userdir directive since the vhost.conf file is loaded last.
Whenever a user goes to [secure.example.com...] it gets mapped to /home/httpd/vhosts/domain/httpdocs/. This is what allows you to share the SSL certificate among other domains.
A server you can't POST to is rather useless for doing business on the web. So if you get no help, you need to consider switching hosts, with support as a major consideration...
There is simply no way for us here to guess what may be causing your problem, but the most likely cause is that the server is misconfigured in some fundamental way.
Jim
I am just moving to this host and by all accounts, they have been alright with support. But you guys put it in a clear terms.
I am not sure what to do now. I am the one who recommended these guys. This is very stressful.
j
___
The VPS includes the default apache configuration -- if anything on it needs to be changed, you are free to make those changes at your own discretion. I'm guessing that the post below assumes that you do not have root access to the server to make any changes, as is often the case. If you would like us to make any changes to the server configuration, we can do so at our $90.00/hr tech support rate along with your guidelines on what you'd like changed. I don't mean to be difficult -- the problem here is that we have no knowledge of the scripts you are trying to run or what the end result should be, which is why we do not provide this type of support. I hope that makes sense. The suggestion you received below on generating a simple 'hello world' script on the server to be sure it works might help point you in the right direction on where to begin troubleshooting your scripts.
___
if it works, then php works
- you tried an html form
it didn't post, seems apache is disallowing posts
- check for .htaccess files on your site
if found you need to rename them or remove them
- if no .htaccess or if they are all renamed and the post still doesn't work
then it is an apache config prob
The VPS includes the default apache configuration
apache default conf has post enabled
we can do so at our $90.00/hr tech support rate
fat chance, I wouldn't pay them a cent since they obviously have no idea what they are talking about.
If I was losing money, I sure would... But not until the problem is fixed... :)
The only problem I'm having with their tech support (the answers generally seem lucid, if not all that concerned) are their blind refusal to acknowledge that the problem is reportedly with POST, not with the script being POSTed-to. If you use an html form to do the POST, and have it POST to a non-existent script, I'd assume you'll still get the "Method Not Allowed" error. I guess you could try that and see.
The response you got is correct; I assumed you did not have access to the (virtual) server configuration. If you do have access to httpd.conf, then go through it and see if you can find any references to HEAD, GET, PUT, DELETE, POST, TRACE, PROPFIND, etc. or any mention of the word "Method" as in "HTTP Method". If httpd.conf places access restrictions on the POST method, then that would explain your problem.
Jim
I check httpd.conf for virtual server and I check main "httpd.conf"
This is from my consultant above...I inserted Jim's comments from your last post and this was his reply.
Why can't this be figured out?
in most of the cases the nastiest problems are caused by a seriously simple mistake/problem.