Home >Backend Development >PHP Problem >How to display errors on php page?

How to display errors on php page?

coldplay.xixi
coldplay.xixiOriginal
2020-07-18 10:50:104750browse

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 php page?

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

  • ##E_USER_NOTICE

    User-defined notifications may have errors in the script

  • E_USER_WARNING

    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

  • E_Warning

    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.

  • All PHP error mechanisms have been built into the PHP function. The PHP error mechanism can print simple error messages and display errors. File line number and other functions.
  • 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
  • At this time, the php error mechanism will print out All error messages.

Related learning recommendations:

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!

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