note 89648 modified in errorfunc.configuration by googleguy

From: Date: Thu, 13 Jun 2013 11:36:36 +0000
Subject: note 89648 modified in errorfunc.configuration by googleguy
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-195193@lists.php.net to get a copy of this message
Using <?php ini_set('display_errors', 1); ?> at the top of your script will not catch any parse errors. A missing ")" or ";" will still lead to a blank page. This is because the entire script is parsed before any of it is executed. If you are unable to change php.ini and set display_errors On then there is a possible solution suggested under error_reporting: <?php error_reporting(E_ALL); ini_set("display_errors", 1); include("file_with_errors.php"); ?> [Modified by moderator] You should also consider setting error_reporting = -1 in your php.ini and display_errors = On if you are in development mode to see all fatal/parse errors or set error_log to your desired file to log errors instead of display_errors in production (this requires log_errors to be turned on). --was-- Using <?php ini_set('display_errors', 1); ?> at the top of your script will not catch any parse errors. A missing ")" or ";" will still lead to a blank page. This is because the entire script is parsed before any of it is executed. If you are unable to change php.ini and set display_errors On then there is a possible solution suggested under error_reporting: <?php error_reporting(E_ALL); ini_set("display_errors", 1); include("file_with_errors.php"); ?> [Modified by moderator] You should also consider setting error_reporting = -1 in your php.ini and display_errors = On if you are in development mode to see all fatal/parse errors or set error_log to your desired file to log errors instead of display_errors in production. http://php.net/manual/en/errorfunc.configuration.php

« previous php.notes (#195193) next »