This question has been asked before in a more general way. I want to display error messages on a particular page on my production server, and I do not have access to the php.ini file. What is the best way to enable all errors and warnings on a particular PHP page on your production server?
I have tried ERROR_REPORTING(E_ALL);.
To enable errors, you must use
error_reportingbefore the point where those are triggered (for example, at the beginning of your PHP script) :And to have the error displayed, you should configure
display_errors:(This one should be disabled on a production server, which means you might have to enable it this way, even after having configured
error_reporting)Of course, all this can be encapsulated in an
ifblock, to make sure only you can see the error messages — especially if you are doing this on a live production website ; for instance :And to get things a bit prettier, you might also want to configure
html_errors: