S
S
SagePtr2018-07-04 00:17:22
PHP
SagePtr, 2018-07-04 00:17:22

Is it possible to display a beautiful page on a PHP error without too much perversion?

The problem is that if an unhandled exception occurs in the script, then the page is empty, regardless of the fact that Apache or nginx have their own ErrorDocument 500 configured, although the return code is set correctly - 500.
Or for these purposes, you must definitely set your own handler for uncaught exceptions, in this handler collect Stack trace from the caught exception, translate all this into a string, if log_errors is set to true - then write to the web server logs, and if display_errors is set to true - then display it on the screen, if display_errors is not set - then display a nice 500 page? Or is there some way to simplify this?
If it is necessary to pervert, then there is some lightweight component that performs the above and does not pull the half-framework along with it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
DevMan, 2018-07-04
@SagePtr

it is possible, it all depends on how both the puff and the web server are configured.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question