实时服务器上的Symfony2 MethodNotAllowedHttpException [英] Symfony2 MethodNotAllowedHttpException on live server

查看:67
本文介绍了实时服务器上的Symfony2 MethodNotAllowedHttpException的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在实时服务器上遇到以下错误:


request.ERROR:未捕获的PHP异常
Symfony\Component\ \HttpKernel\Exception\MethodNotAllowedHttpException:
/ home / public_html / project / app / cache / prod上找不到 GET user / create:不允许的方法(允许:
POST)的路由 /classes.php行
3685


但我在具有相同代码的本地计算机上未收到此错误。 / p>

解决方案指向清除缓存,但我无法了解如何清除活动服务器上的缓存。



我还从实时服务器上删除了缓存文件夹,但问题仍然存在。



更新
问题出奇的是解决了更新base.html.twig文件后解决的问题。我认为此后缓存会重新生成并具有一些依赖关系,但由于删除缓存文件夹并不能解决问题,但base.html.twig文件的更改并不能解决它的问题。他工作。

解决方案

尝试运行 php应用/控制台router:debug | grep user / create 检查此路由是否全部加载。也许您只为特定的环境加载此路由。


I am getting below error on live server:

request.ERROR: Uncaught PHP Exception Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException: "No route found for "GET user/create: Method Not Allowed (Allow: POST)" at /home/public_html/project/app/cache/prod/classes.php line 3685

but I am not getting this error on a local machine with the same code.

Solutions points to clearing the cache, but I am not able to get how we can clear cache on a live server.

I also deleted cache folder from live server, but the issue still persists.

UPDATE: The issue is surprisingly solved after updating base.html.twig file. i think cache regenerates again with some dependencies after that. but still i did not get how it is resolved as deleting cache folder does not resolved it but changes in base.html.twig file does the job.

解决方案

Try to run php app/console router:debug | grep user/create to check if this route loaded at all. Maybe you load this route only for specific env.

这篇关于实时服务器上的Symfony2 MethodNotAllowedHttpException的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆