How to display errors on the php page: First, you need to configure the [error_reporting] directive in the [php.ini] file, the code is [error_reporting = E_ALL]; then the php error mechanism will print out all error information. .
How to display errors on the php page:
Error level
# The##error_reporting directive is used to determine the sensitivity level of the report. PHP5.4.15 includes a total of 16 different sectors. Any combination within these levels is valid. The commonly used levels are as follows:
E_ALL ## Serious error, unrecoverable. Such as insufficient memory, location exception or repeated class declaration, etc.
E_NOTICE The running code is performing some unknown actions, such as reading undefined variables, etc.
E_USER_ERROR User-defined errors cause php to exit execution
User-defined notifications may have errors in the script
User-defined errors will not cause php to exit. The script can be used to notify an execution failure. If the execution fails, php will also use E_WARNING to notify
The type of error that often occurs, indicating an error in operation. Such as missing function parameters, failure to connect to the database, divisor is 0, etc.
To print out error information, you generally need to configure the error_reporting
directive in the php.ini file. The code is as follows:
error_reporting = E_ALL
PHP programming from entry to proficiency
The above is the detailed content of How to display errors on php page?. For more information, please follow other related articles on the PHP Chinese website!