Home >Backend Development >PHP Tutorial >Solution to php shutdown warning problem, phpwarning_PHP tutorial
error_reporting sets the level of error message reporting
2047 I remember it should be E_ALL.
There are many configuration settings in the php.ini file. You should have set up your php.ini file and placed it in the appropriate directory, as documented in the instructions for installing PHP and Apache 2 on Linux (see Resources). When debugging PHP applications, there are two configuration variables that you should be aware of. Here are the two variables and their default values:
display_errors = Off
error_reporting = E_ALL
E_ALL covers everything from bad coding practices to harmless tips to errors. E_ALL is a bit too fine-grained for development as it also displays hints on the screen for small things (such as variables not being initialized) which messes up browser output
So it is not recommended to use 2047. It is best to change the default value to: error_reporting = E_ALL & ~E_NOTICE
Solution to the failure of display_errors = Off in PHP.ini
Question:
Display_errors = Off has been set in the PHP setting file php.ini, but during operation, error messages still appear on the web page.
Solution:
After checking log_errors=On, according to the official statement, when this log_errors is set to On, then the error_log file must be specified. If it is not specified or the specified file does not have permission to write, then it will still be output to the normal output channel, then This makes the specified Off of display_errors invalid, and the error message is still printed. So set log_errors = Off and the problem is solved.
It is often seen that error_reporting (7) means: setting the level of error message reporting.
value constant
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
2047 E_ALL
2048 E_STRICT
However 7=1 2 4
It means 1 E_ERROR 2 E_WARNING 4 E_PARSE
is displayed when an error occursThe above solution to the PHP shutdown warning problem is all the content shared by the editor. I hope it can give you a reference, and I hope you will support Bangkejia more.