Apache custom 500 error not showing after php syntax error
Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Apache custom 500 error not showing after php syntax error
I have Apache set up to display custom error pages for the most common http errors. All of them are working fine except the 500 error. When a php script crashes, I should get a 500 error, and I do, just the wrong one. Apache's standard 500 error message shows, instead of my custom one.
When I go directly to the error page from a browser, it shows up just fine.
All of the error pages are created in a php file, to give more useful information than a static page. Could this be why it doesn't show up when a script dies because of a syntax error?
That is what I am using in my virtual server config file.
I just realized that I am actually not getting the Apache error page, I am getting a blank page. There is no html being sent to the browser. Chrome shows a generic built-in 500 error and firefox and safari show a blank page.
There are errors, but not on the 500 error page. It works fine when I go straight to it from a browser. It's when another php script errors out and apache tries to send the error page that it doesn't work.
When I turn display_errors on, I see the php syntax error, but nothing about the custom error page. It's like apache isn't even trying to load the page.
Oh. I thought that was the error because that is the one that Chrome shows when a php script has an error. Is that just what Chrome shows when it gets a page with no data?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.