即使在 NGINX 上发布到 php 文件时也不允许使用方法 (405)
我一直在谷歌搜索,我所能找到的就是当您发布到 html 文件时可能会发生此错误。在我的设置中,我有一个重写规则,它基本上隐藏了 url 中的 index.php 文件,而且我很长一段时间认为它与此有关。 Get 工作正常,但由于某种原因 Get 无法与 OpenID 一起使用。
不允许的方法
URL /post.php 不允许 POST 请求
这是我的设置:
Debian squeeze / AMD64
nginx version: nginx/1.1.8
PHP 5.3.3-7+squeeze3 with Suhosin-Patch (cli) (built: Jun 28 2011 08:24:40)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
with Suhosin v0.9.32.1, Copyright (c) 2007-2010, by SektionEins GmbH
I been googling, and all I can find is that this error may happen when you post to an html file. In my setup I have a rewrite rule, that basically hides the index.php file from the url, and I for the longest time thought it had something to do with that.
Get works fine, but Get for some reason doesn't work with OpenID.
Method Not Allowed
POST request is not allowed for the URL /post.php
Here is my setup:
Debian squeeze / AMD64
nginx version: nginx/1.1.8
PHP 5.3.3-7+squeeze3 with Suhosin-Patch (cli) (built: Jun 28 2011 08:24:40)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
with Suhosin v0.9.32.1, Copyright (c) 2007-2010, by SektionEins GmbH
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我刚刚自己解决了这个问题!
我安装了lighttpd,并且在lighttpd 中再次遇到同样的错误。
我正在查看所有错误的地方,因为错误 405 是网络服务器错误。
然而,我刚刚开始使用一个名为 fatfree F3 的新 php 框架,当您像这样使用 GET 时,该框架会生成错误:
GET 意味着该框架只需要 GET 变量并将拒绝 POST 变量。
就是服务器错误 405!
因此,将其更改为,以下方法就达到了目的:
您甚至可以使用此命令让框架接受两者或其中一个;
I just solved this problem my self!
I installed lighttpd, and got the same error again with lighttpd as well.
I was looking at all the wrong places because the error 405 is a webserver error.
However, I just started using a new php framework called fatfree F3, and the error is being generated by this framework when you use GET like so:
The GET means that the framework is expecting only GET variables and will reject POST variables.
With a server error 405, that is!
So changing that to, following did the trick:
And you can even let the framework accept both or either with this command;
我遇到了同样的错误。
我的问题是 POST 函数不接受第二个参数
I was getting the same error.
My problem was that the POST function did not accept a second argument