Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How the php profile defines the error level

2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article will explain in detail how to define the error level in the php configuration file. The editor thinks it is very practical, so I share it for you as a reference. I hope you can get something after reading this article.

Php configuration file defines the error level of the method: 1, open the PHP installation directory, find and open the "php.ini" configuration file; 2, in the configuration file, find the "error_reporting" item, set the value of the item to the desired error type.

Operating environment of this tutorial: windows7 system, PHP7.1 version, DELL G3 computer

The method of defining error level in php configuration file

1. Open the PHP installation directory, find and open the php.ini configuration file

2. In the configuration file, find the "error_reporting" item and set the value of the item to the error type you need.

The error types in PHP are shown in the following table:

A value constant describes a fatal runtime error in 1E_ERROR, which is generally unrecoverable, such as a problem caused by memory allocation, which causes the script to terminate and no longer run. 2E_WARNING runtime warning (non-fatal error), only prompts are given, but the script does not stop running. 4E_PARSE compile-time syntax parsing errors are generated only by the parser. The 8E_NOTICE runtime notification indicates that the script encounters a condition that may appear as an error, but there may be a similar notification in a script that works properly. A fatal error in 16E_CORE_ERROR during PHP initialization startup, similar to E_ERROR, but generated by the core of the PHP engine. Warnings (non-fatal errors) that occur during 32E_CORE_WARNINGPHP initialization startup, similar to E_WARNING, but generated by the core of the PHP engine. 64E_COMPILE_ERROR is a fatal compile-time error, similar to E_ERROR, but generated by the Zend scripting engine. 128E_COMPILE_WARNING compile-time warnings (non-fatal errors), similar to E_WARNING, but generated by the Zend scripting engine. The error message generated by the 256E_USER_ERROR user is similar to E_ERROR, but is generated by the user himself using the PHP function trigger_error () in the code. The warning message generated by the 512E_USER_WARNING user is similar to E_WARNING, but is generated by the user himself using the PHP function trigger_error () in the code. The notification information generated by the 1024E_USER_NOTICE user is similar to E_NOTICE, but is generated by the user himself using the PHP function trigger_error () in the code. 1024E_STRICT enables PHP's recommendations for changes to the code to ensure optimal interoperability and forward compatibility. A fatal error that 2048E_RECOVERABLE_ERROR can catch indicates that a potentially dangerous error has occurred, but has not yet caused the PHP engine to be in an unstable state. If the error is not caught by the user-defined handle, it becomes an E_ERROR, causing the script to stop running. 8192E_DEPRECATED runtime notification that, when enabled, warns code that may not work properly in future releases. The warning message generated by the 16384E_USER_DEPRECATED user is similar to E_DEPRECATED, but is generated by the user himself using the PHP function trigger_error () in the code. All error and warning messages except 30719E_ALLE_STRICT.

You can also use the error_reporting () function in the PHP file to define the error level.

This is the end of this article on "how to define the error level of php configuration files". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report