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 does PHP turn on the error message?

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

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

Most people do not understand the knowledge points of this article "PHP how to open error tips", so the editor summarizes the following content, detailed content, clear steps, and has a certain reference value. I hope you can gain something after reading this article. Let's take a look at this "PHP how to open error tips" article.

Add directly to the PHP code:

Ini_set ("display_errors", "On"); / / Open the error prompt ini_set ("error_reporting", E_ALL); / / Show all errors

You can turn on the error message.

Error_reporting error level:

E_ALL-all errors and warnings (including E_STRICT in PHP 5.4.0) E_ERROR-fatal run-time errors E_RECOVERABLE_ERROR-near-fatal run-time errors E_WARNING-run-time warnings (non-fatal errors) E_PARSE-compile-time parsing errors E_NOTICE-runtime notifications (these are usually warnings An error from your code, but it may be intentional (for example, using an uninitialized variable and relying on it being automatically initialized to an empty factual string) E_STRICT-runtime notification Allowing PHP to recommend changes to your code will ensure optimal interoperability and forward code compatibility E_CORE_ERROR-fatal errors that occur during PHP initial startup E_CORE_WARNING-PHP warnings (non-fatal errors) Initial startup of E_COMPILE_ERROR-fatal compile-time error E_COMPILE_WARNING-compile-time warning (non-fatal error) E_USER_ERROR-user-generated error message E_USER_WARNING-user-generated warning message E_USER_NOTICE-user-generated notification message E_DEPRECATED-warning code does not work in future versions of PHP USER_DEPRECATED-user-generated deprecation warning

Some of the most common settings for error_reporting:

E_ALL (displays all errors, warnings and notifications, including coding standards. ) E_ALL & ~ E_NOTICE (displays all errors except notifications) E_ALL & ~ E_NOTICE & ~ E_STRICT displays all errors except notifications and coding standard warnings. ) E_COMPILE_ERROR | E_RECOVERABLE_ERROR | E_ERROR | E_CORE_ERROR (only errors are displayed)

In the development environment, you can modify the php.ini file and set display_errors = On to turn on the error message.

Error_reporting = E_ALL; display all errors display_errors = Off; turn off error prompt log_errors = On; enable error log log_errors_max_len = 1024; set maximum log length error_log = / usr/local/error.log The above location of the error log file is about the content of this article on "how to open error tips for PHP". I believe we all have a certain understanding. I hope the content shared by the editor will be helpful to you. If you want to know more related knowledge, please pay attention to the industry information channel.

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