How to enable error reporting in PHP?

The error_reporting() function sets the error_reporting directive at runtime. PHP has many levels of errors, using this function sets that level for the duration (runtime) of your script. If the optional level is not set, error_reporting() will just return the current error reporting level.

 

check if “display_errors” is equal “on” in the php.ini or declare

“ini_set('display_errors', 1)”

in your script.
Then, include

“error_reporting(E_ALL)”

in your code to display all types of error messages during the script execution.

Enabling error messages is very important especially during the debugging process as you can instantly get the exact line that is producing the error and you can see also if the script in general is behaving correctly.

For more details just read the PHP Documentation by clicking below link..

[button color=”blue” size=”small” link=”http://php.net/manual/en/function.error-reporting.php” icon=”” target=”false”]PHP documentation[/button]
I hope this will helpful of you.. cheers!



Author: Divakarcool
I am Divakar Kumar Software Engineer in IT Company since 3 Years.I studied Master in Computer Application(MCA). I love to read and write code and blogs, watching movies, Video games.

Leave a Reply

Hey there!

Sign in

Forgot password?
Close
of

Processing files…