PHP display all errors and warnings

When writing a program in PHP it is a good idea to activate all the errors and warnings that often occur during development.
Many hosts have the display of errors disabled, so you can ‘go against unexpected and unwelcome behavior, here’s how to activate in php all errors, warnings and notices:

ini_set('display_errors', '1'); 

This code must be inserted at the beginning of the file to activate the display of errors in the file itself, if you can edit the configuration file of the php, the php.ini file, you must look inside the file for the line where there is the property ‘error_reporting.

This property must be modified in this way:

error_reporting = E_ALL

Leave a Comment

Your email address will not be published. Required fields are marked *