5
votes

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

2
If it's any help, this is the advice I followed to get mine working, but it doesn't use .htaccess...Matt Gibson
Yeah i looked at that and realised that the error needed to be in the config folder :)terrid25
Cool; in that case I'll post a proper answer that you can accept :)Matt Gibson

2 Answers

9
votes

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.

1
votes

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