Friday, December 31, 2021

PHP 500 error does not redirect to custom error page in httpd

I have custom error pages working with the errdocs directive in
httpd.conf.

400 not found and 500 internal error both works.

If I manually create an internal error by misconfiguring httpd by using
something like:

fastcgi socket "/run/foo.sock"

Then httpd will display the custom 500 page.

However, when I manually raise a 500 error with PHP by throwing an
exception, the browser receives a 500 responds header, but the custom
500 page is not shown when display errors is off.

I understand that a 500 error IS a web server internal error, and PHP
is kindda running on top of that, but should httpd not use the custom
500 error page when PHP is creating a 500 error?

What have I misunderstood?

No comments:

Post a Comment