Enable Error Reporting in PHP
Error Reporting: Sometimes you run PHP site and something went wrong and page doesn’t display any warning, notice or error regarding the issue. thats because your PHP config file is configured for not showing error, means error reporting is off. You can turn it on by using one of these functions into your index.php file, if you don’t want to configure your php.ini file.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
// Turn off all error reporting error_reporting(0); // Report simple running errors error_reporting(E_ERROR | E_WARNING | E_PARSE); // Reporting E_NOTICE can be good too (to report uninitialized // Variables or catch variable name misspellings ...) error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE); // Report all errors except E_NOTICE // This is the default value set in php.ini error_reporting(E_ALL ^ E_NOTICE); // Report all PHP errors (see changelog) error_reporting(E_ALL); // Report all PHP errors error_reporting(-1); // Same as error_reporting(E_ALL); ini_set('error_reporting', E_ALL); |
For more updates please like our FB Page.