Output PHP error if only a white page is displayed

White page and no error message, what to do if the PHP script does not want to.

Recently I had the problem that a PHP script was not running for a customer. Instead, only a white page was displayed. The whole thing can often be solved with a .htaccess file, but unfortunately this was not supported in this specific case.

Instead, I solved it like this:

error_reporting(E_ALL);
ini_set("display_errors", 1);

The lines activate error reporting and set the setting that PHP error messages are displayed in the browser. It is inserted at the beginning of the script.

Leave a Reply

Your email address will not be published. Required fields are marked *