-
Notifications
You must be signed in to change notification settings - Fork 388
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
405: Method Not Allowed #62
Comments
405是nginx输出的,如果请求打到了一个静态文件上,并且是post请求就会这样,检查下nginx配置吧 |
楼上说的没错,但是如果hprose能支持GET请求(默认好像都是POST的?)静态资源这个问题是可以解决的。 这样的应用场景比较多,当nginx要实现伪静态时,大部分都是类似xx.html, xxx/xx/这种地址,不支持的话应付不了很多场景,apache也是类似。 |
@ycaihappy 你没看明白,伪静态是可以可以的,但是这个明显是你的nginx配置错误,Client必须请求到一个Serve,请确认这个请求'http://xxxx/wus/v1/'能否到Serve |
贴出你的nginx配置一看就知道了。这个肯定是rewrite配置不对,导致请求没有到hprose上 或者说没有到php-fpm |
@Liv1020 http://xxxx/wus/v1/ 是可以得到服务结果的。。 问题已经解决。原因是使用lumen框架的时候路由注册的是GET,改成POST就可以了。谢谢大家关注。 POST /wus/v1/ HTTP/1.1" 405 没改lumen前 |
PHP Fatal error: Uncaught Exception: 405: Method Not Allowed
使用如下代码时,会报错,服务端使用nginx加了一个重定向wus/v1/ => public/index.php?version=v1
$client = Client::create('http://xxxx/wus/v1/', false);
$client->xxx();
不知道怎么处理?
The text was updated successfully, but these errors were encountered: