When I kick the website I'm building over to my production server, I want the production server to show a custom .html page whenever the user tries to load a page with a PHP error on it.
On my in-home development server, I currently have the php.ini error values set to production values, so the browser only shows a "500 Server Error" page when I load a page I knowingly have syntax errors on. I tried using an .htaccess file with
ErrorDocument 500 /500.html written in it to intercept that error. But it didn't work; the browser still showed me the default 500 page.
After a little Google-fu, I'm being led to believe that PHP syntax errors do not trigger a real 500 error, which is why my custom page won't load.
Is there a way to load a custom error page when the browser tries to load a page with a PHP syntax error on it?
I have carte blanche to do what I will with my in-home server, but I pay for hosting on my production server, so I'm limited to using PHP code and .htaccess files. I want to rig my in-home server so it uses pretty much the same rules as the production server when I migrate the site over. Their server logs all PHP errors to an error_log file when a bad page is loaded. I just want to make it so the end-user sees something a little more helpful if there are migration issues while migrating, but not see any detail about the syntax error itself.