Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

symfony - 500 error page customisation problem

I am ready to push a site to production (currently on staging), but I'm having a slight problem with the internal server error 500 page.

I have created a file in web/errors/error500.php and I've also got: ErrorDocument 500 errors/error500.php in my .htaccess file

The problem is, if there is a 500 error in the admin, it displays the symfony default 500 page instead of mine in the errors folder.

Does anyone have a rough idea why this is?

I've cleared symfony cache, cleared browser cache and used several browsers.

Thanks

like image 638
terrid25 Avatar asked Mar 30 '11 15:03

terrid25


2 Answers

The standard Symfony way of doing this isn't with an Apache ErrorDocument directive, but simply by putting your error page in either <project>/apps/<appname>/config/error/error.html.php or <project>/config/error/error.html.php, for per-app or general error pages respectively. See this checklist item on the very handy Symfony Deployment Cheat Sheet.

like image 129
Matt Gibson Avatar answered Oct 25 '22 18:10

Matt Gibson


Also make sure you are not in debug mode when you test this otherwise it will still show full stack trace.

like image 30
Jbronson Avatar answered Oct 25 '22 16:10

Jbronson