dongsu7049 2016-05-29 07:30
浏览 111

symfony自定义错误页面生产环境

I created custom error pages for symfony.

In development enviroment it works by using the following from the handbook:

http://localhost/app_dev.php/_error/{statusCode}

This is working.

But now in the production environment. I prepared the production environment with the following code:

php bin/console cache:clear --env=prod --no-debug

This is not working, I do not get my custom error page but the default one.

I found some articles on stackoverflow but not with the right solution.

  • 写回答

2条回答 默认 最新

  • dougu6815 2016-05-29 08:24
    关注

    If you use the standard edition, then /_error is mounted under routing_dev.yml. That's mean that it's available only on dev environment. You can move it from routing_dev.yml to routing.yml.

    # app/config/routing.yml
    _errors:
        resource: "@TwigBundle/Resources/config/routing/errors.xml"
        prefix:   /_error
    
    评论

报告相同问题?

悬赏问题

  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 保护模式-系统加载-段寄存器