1ini_set('display_errors', '1');
2ini_set('display_startup_errors', '1');
3error_reporting(E_ALL);
1ini_set('display_errors', 1);
2ini_set('display_startup_errors', 1);
3error_reporting(E_ALL);
4
1/* Display all errors like dev */
2ini_set('display_errors', 1);
3ini_set('display_startup_errors', 1);
4error_reporting(E_ALL);
5
6/* Display PROD errors */
7ini_set('display_errors', 1);
8ini_set('display_startup_errors', 0);
9error_reporting(E_ALL & ~E_NOTICE);
10
11/* OTHER SETTINGS*/
12
13// Report simple running errors
14error_reporting(E_ERROR | E_WARNING | E_PARSE);
15
16// Reporting E_NOTICE
17error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE);
18
19// Report all errors except E_NOTICE
20error_reporting(E_ALL & ~E_NOTICE);
21// For PHP < 5.3
22error_reporting(E_ALL ^ E_NOTICE);
23
24// Report all PHP errors
25error_reporting(E_ALL);
26//or
27error_reporting(-1);
28//or
29error_reporting(0);
1// how to display php errors on your browser :
2// first step, create an error function :
3
4$errors = array();
5
6// now you have just to insert the function like this :
7
8if (........){
9 $errors['the_name_of_the_error']='the error message';
10}
11
12// example :
13// we want to display an error when the user does not correctly fill,
14// in the 'password' box when registering on your website :
15
16if(empty($_POST['password']) ||
17 $_POST['password'] != $_POST['password_confirm']){
18 $errors['errors']= "You must enter a valid password";
19}
1error_reporting(-1);
2ini_set('display_errors', 'On');
3set_error_handler("var_dump");
4