Php error handling 1. view the source code of the error type and copy it to the clipboard to print help; E_ALL & nbsp; //-all errors and warnings (excluding E_STRICT ). & nbsp; E_ERRO php error handling
I. types of errors
View source code Copy to clipboard printing help
; E_ALL //-all errors and warnings (excluding E_STRICT ).
; E_ERROR //-fatal runtime error
; E_RECOVERABLE_ERROR //-almost fatal runtime error
; E_WARNING //-warning during running (non-fatal error)
; E_PARSE //-parsing error during compilation
; E_NOTICE //-runtime prompts, which are often caused by bugs in the code.
; E_STRICT //-runtime prompt, which can give PHP suggestions to improve your code.
; E_CORE_ERROR //-fatal error during PHP initialization startup.
; E_CORE_WARNING // non-fatal error during PHP initialization startup.
; E_COMPILE_ERROR //-fatal compilation error.
; E_COMPILE_WARNING //-compilation error (non-fatal error ).
; E_USER_ERROR //-user error message.
; E_USER_WARNING //-user warning information.
; E_USER_NOTICE //-user prompt information .;
II. display of php. ini configuration errors
View source code Copy to clipboard printing help
// 1. the error message is output to the client (this is more convenient when debugging code)
Display_errors = ON
// 2. the error message will not be output to the user end (remember to change it to off when it is finally published to the user)
Display_errors = OFF
3. php. ini error output configuration recommendation
View source code Copy to clipboard printing help
// 1. output all information.
Error_reporting = E_ALL
// 2. output all errors except the prompt.
Error_reporting = E_ALL &~ E_NOTICE
// 3. all ERROR messages are output.
Error_reporting = E_COMPILE_ERROR | E_RECOVERABLE_ERROR | E_ERROR | E_CORE_ERROR
4. complete error levels in php
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.