-2

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.

2
  • If you have some time, read this section of the manual, it will clear so much things about error handling for you : php.net/manual/en/book.errorfunc.php Commented Dec 4, 2017 at 14:13
  • You can use a try...catch statement to catch all of the exceptions. Commented Dec 4, 2017 at 14:16

2 Answers 2

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

Sign up to request clarification or add additional context in comments.

Comments

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.