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 to make discuz display php error

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

Editor to share with you how to let discuz display php errors, I believe that most people do not understand, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!

The way to get discuz to display php errors: you can use the error_reporting function to do so. The error_reporting function can set the php error level, such as [error_reporting (report_level)].

1. Set the error level of PHP by configuring parameters in php.ini

You can add a row at the appropriate location in the php.ini

The following is the referenced content:

Error_reporting = E_ALL

Note: some examples are given in the implementation in php.ini, such as the following in my local php.ini

The following is the referenced content:

; Examples:;-Show all errors, except for notices and coding standards warnings;error_reporting = E_ALL & ~ eigenNote;-Show all errors, except for notices;error_reporting = E_ALL & ~ E_NOTICE | Epistasis;-Show only errors;error_reporting = E_COMPILE_ERROR | E_RECOVERABLE_ERROR | E_ERROR | Epistrate error;-Show all errors except for notices and coding standards warnings;error_reporting = E_ALL & ~ E_NOTICE

All I have to do is add error_reporting = E_ALL to the bottom of these lines of code and restart the web service

Second, set the PHP error level through the PHP function error_reporting

If you do not have permission to modify the parameter configuration in php.ini, you can use this function to set the error level.

How to use the error_reporting () function

Error_reporting (report_level)

If the parameter level is not specified, the current error level is returned.

Any number of the above options can be connected with "or" (using OR or |) so that all required levels of errors can be reported. For example, the following code turns off user-defined errors and warnings, performs some actions, and then reverts to the original error level:

The following is the referenced content:

/ / disable error reporting error_reporting (0); / / report runtime errors error_reporting (E_ERROR | E_WARNING | E_PARSE); / / report all errors error_reporting (E_ALL); then we can put error_reporting (0) in the include/common.inc.php file in the forum

Modify to

Error_reporting (E_ALL)

Then save it so that you can see the error message reported by PHP

The above is all the contents of the article "how to make discuz display php errors". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow 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

Servers

Wechat

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

12
Report