How to display PHP errors in code output?
When executi开发者_开发问答ng a PHP page through browser , we will just get the output but not the errors in code.
how can i view the errors occurred by the code in the backend??
I am using the following in the code for error reporting..
error_reporting(E_ALL | E_ALL);
ini_set('display_errors', 1);
error_reporting(E_ALL ^ E_NOTICE);
Try -1
. From the documentation, "Passing in the value -1 will show every possible error, even when new levels and constants are added in future PHP versions."
// Report all PHP errors
error_reporting(-1);
If that doesn't work, try to do an ini_set
:
// Same as error_reporting(E_ALL);
ini_set('error_reporting', E_ALL);
Inside your php.ini, set the display_errors
to On
:
display_errors = On
Then restart your web server.
精彩评论