【发布时间】:2016-01-19 21:41:42
【问题描述】:
我有一个 symfony 应用程序,在生产服务器中运行时无法正确处理 404 错误,这是我在错误日志中得到的错误:
Fatal error: Uncaught exception 'Symfony\Component\Routing\Exception\ResourceNotFoundException' in /var/www/site/releases/20160119210649/app/cache/prod/appProdUrlMatcher.php:7768
Stack trace:
0 /var/www/site/releases/20160119210649/app/cache/prod/classes.php(1419): appProdUrlMatcher->match('/daf')
1 /var/www/site/releases/20160119210649/app/cache/prod/classes.php(8339): Symfony\Component\Routing\Matcher\UrlMatcher->matchRequest(Object(Symfony\Component\HttpFoundation\Request))
2 /var/www/site/releases/20160119210649/app/cache/prod/classes.php(2483): JMS\I18nRoutingBundle\Router\I18nRouter->matchRequest(Object(Symfony\Component\HttpFoundation\Request))
3 [internal function]: Symfony\Component\HttpKernel\EventListener\RouterListener->onKernelRequest(Object(Symfony\Component\HttpKernel\Event\GetResponseEvent), 'kernel.request', Object(Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher))
4 /var/www/site/releases/20160119210649/app/cache/prod/classes.php(2264): call_user_func(Array, O in /var/www/site/releases/20160119210649/app/cache/prod/classes.php on line 5336
我在 /app/Resources/TwigBundle/views/Exception/error404.html.twig 中自定义了 404 错误 我已经清除了缓存,甚至重新启动了 php 和 nginx。
【问题讨论】:
-
@JakubZalas 我调查了那些,情况不一样。第一种情况是关于 404 模板中不存在的路由,不是这种情况。第二个是关于扩展模板的错误
-
嗯,您需要提供更多详细信息...您检查过日志吗?
-
是的,我只看到我已经粘贴的错误