-3

I would like to try to change the formatting of fatal error but I can only modify the values of message, file and line. enter image description here I would expect to be able to change the css and the html of the message.

Thanks in advance.

XaBerr
  • 320
  • 2
  • 16
  • If you have some time, read this section of the manual, it will clear so much things about error handling for you : http://php.net/manual/en/book.errorfunc.php – teeyo Dec 04 '17 at 14:13
  • You can use a try...catch statement to catch all of the exceptions. – Zeke Dec 04 '17 at 14:16

2 Answers2

1

Fatal errors in PHP are catchable, so you can make your own exception handler or even use a third party package like https://github.com/filp/whoops

0

You can catch fatal errors in PHP. Refer to this answer here:

https://stackoverflow.com/a/4410769/9051466

After determining if its a fatal error, you can just create a custom page, redirect the user to that custom page, then display what error message you want the user to see.