路由目录:E:\modong\Modong_Kaike\src\CustomBundle\Resources\config

如果app.php为生产模式的话,那么配置的路由不会起作用。

报错如下:
[2021-10-15 19:00:11] request.ERROR: Uncaught PHP Exception Symfony\Component\HttpKernel\Exception\NotFoundHttpException: "No route found for "POST /kaike/ehome/manage/questionbank/create"" at E:\modong\Modong_Kaike\app\cache\prod\Jianmo\classes.php line 2108 {"exception":"[object] (Symfony\\Component\\HttpKernel\\Exception\\NotFoundHttpException(code: 0): No route found for \"POST /kaike/ehome/manage/questionbank/create\" at E:\\modong\\Modong_Kaike\\app\\cache\\prod\\Jianmo\\classes.php:2108, Symfony\\Component\\Routing\\Exception\\ResourceNotFoundException(code: 0): at E:\\modong\\Modong_Kaike\\app\\cache\\prod\\Jianmo\\appProdProjectContainerUrlMatcher.php:11363)"} []
解决方法:将app.php的生产模式改为开发模式
$kernel = new AppKernel('dev', true); //开发模式
网友评论