PHP shows the error prompt method introduction. The following describes how to enable the USU prompt in php. For more information, see. I. two configuration variables are involved in php. ini configuration. The following describes how to enable the USU prompt in php. For more information, see.
I. php. ini configuration
In the php. ini configuration, there are two configuration variables related to this. The two variables and their default values are as follows:
The following is a reference clip:
| The code is as follows: |
|
Display_errors = Off Error_reporting = E_ALL &~ E_NOTICE |
The purpose of the display_errors variable is obvious-it tells PHP whether an error is displayed. The default value is Off. The purpose is to display the error prompt:
The following is a reference clip:
| The code is as follows: |
|
Display_errors = On |
E_ALL: this setting displays all the information from bad code practices to harmless prompts to errors. E_ALL is a little too detailed for the development process because it displays a prompt even if the variable is not initialized, which is a feature of PHP "advanced. Fortunately, the default value of error_reporting is "E_ALL &~ E_NOTICE ", so that only the error and bad code are displayed, and no negative prompt is displayed for the program.
After modifying php. ini, you need to restart Apache to take effect in apache. of course, if you test the program only in the command line, you do not need this step.
Macro definition of enemy values
| The code is as follows: |
|
1 E_ERROR 2 E_WARNING 4 E_PARSE 8 E_NOTICE 16 E_CORE_ERROR 32 E_CORE_WARNING 64 E_COMPILE_ERROR 128 E_COMPILE_WARNING 256 E_USER_ERROR 512 E_USER_WARNING 1024 E_USER_NOTICE 6143 E_ALL 2048 E_STRICT 4096 E_RECOVERABLE_ERROR |
Bytes. I. two configuration variables are involved in php. ini configuration. Below is this...