Home  >  Article  >  Backend Development  >  What are the php.ini error messages?

What are the php.ini error messages?

coldplay.xixi
coldplay.xixiOriginal
2020-08-10 10:32:482596browse

php.ini error prompts include: 1. Turn on display errors, the code is [display_errors = On]; 2. [E_ALL] is all errors and warnings; 3. [E_ERROR] is fatal runtime Error; 4. [E_WARNING] is a runtime warning.

What are the php.ini error messages?

What are the php.ini error prompts:

display_errors = On

//Turn on display error

error_reportingThe parameters that can be set are as follows:

Error reporting is a bit field. You can add up the numbers to get the desired level of error reporting.

  • E_ALL – All errors and warnings (excluding E_STRICT)

  • E_ERROR – Fatal runtime errors

  • E_WARNING – Run-time warning (non-fatal error)

  • E_PARSE – Compile-time parsing error

  • E_NOTICE – Run (These are often caused by bugs in your code, but can also be caused by intentional actions.)

  • E_STRICT – Coding standardization warnings, allowing PHP to suggest how to modify the code to ensure Optimal interoperability and forward compatibility.

  • E_CORE_ERROR - Fatal error during PHP startup initialization

  • E_CORE_WARNING - Warning (non-fatal error during PHP startup initialization) )

  • E_COMPILE_ERROR - Compile-time fatal error

  • E_COMPILE_WARNING - Compile-time warning (non-fatal error)

  • E_USER_ERROR – User-defined error message

  • E_USER_WARNING – User-defined warning message

  • E_USER_NOTICE – User-defined The reminder message

is basically set to:

error_reporting = E_ALL & ~E_NOTICE ;

In addition to prompts, all errors are displayed.

Example:

error_reporting = E_ALL & ~E_NOTICE ; 显示所有的错误,除了提醒
error_reporting = E_COMPILE_ERROR|E_ERROR|E_CORE_ERROR ; 仅显示编译时致命性错误
error_reporting=E_ERROR :只会报告致命性错误

In the php program, the setting for error_reporting is written as follows:

error_reporting(E_ALL);

//or other versions

  • 1 E_ERROR Fatal runtime error

  • 2 E_WARNING Runtime warning (non-fatal error)

  • 4 E_PARSE Compilation time parsing error

  • 8 E_NOTICE runtime reminder (often a bug, it may be intentional)

  • 16 E_CORE_ERROR PHP initialization at startup Fatal error in the process

  • 32 E_CORE_WARNING Warning (non-fatal error) in the initialization process when PHP starts up

  • 64 E_COMPILE_ERROR Fatal during compilation Sexual error

  • 128 E_COMPILE_WARNING Compile time warning (non-fatal error)

  • 256 E_USER_ERROR User-defined fatal error

  • 512 E_USER_WARNING User-defined warning (non-fatal error)

  • 1024 E_USER_NOTICE User-defined reminder (often a bug, it may be intentional)

  • 2048 E_STRICT Encoding standardization warning (recommended how to modify for forward compatibility)

  • 4096 E_RECOVERABLE_ERROR Near-fatal runtime error, if not Capture is treated as E_ERROR

  • ## 6143 E_ALL All errors except E_STRICT (8191 in PHP6, including all)

# Relevant learning recommendations:

php programming (video)

The above is the detailed content of What are the php.ini error messages?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn