Symfony2 error 500 instead of 404 at production

前端 未结 11 1211
野性不改
野性不改 2020-12-06 04:49

In my Symfony2 project I\'m getting at development mode correct 404 Exception screen. But I\'m getting blank screen with HTTP status code 500 instead of 404 at production mo

11条回答
  •  星月不相逢
    2020-12-06 05:12

    Just an complementary note to the given answers: The ResourceNotFoundException can also be thrown if you are trying to include a non existent template. A typical case, is that you refactored your application code but you forgot to update your error pages as they are located in app/Resources and not in your src/ folder or including a given template that use a variable or service that is not defined in the "error" context.

提交回复
热议问题