Current location: home page > course >Body

How can I force the debug mode (development mode) of zblog to be enabled when the background cannot be accessed?

ZBP1.7.2 update:

Zbp1.7.2 has a built-in method to force the debug mode on.

Just find zb_system/function/c_system_base.php

On line 22, change

 //defined('ZBP_DEBUGMODE') || define('ZBP_DEBUGMODE', true);

Remove the previous//to force the debug mode to start.

 How can I force the debug mode (development mode) of zblog to be enabled when the background cannot be accessed? Page 1

Operation method of ZBP1.7.2 and earlier versions:

be familiar with Z-Blog As we all know, there is a debug mode (development mode) in its website settings and global settings. If our website reports an error for unknown reasons, you can turn on the debug mode switch to quickly locate the cause of the error.

Or your website makes an error. Go to the Z-Blog official forum to post for help. You also need to open the debug mode screenshot so that everyone can judge the cause of the error.

 How can I force the debug mode (development mode) of zblog to be enabled when the background cannot be accessed? Page 2

But there is a situation that may make ordinary users helpless.

You have done some operations, and the background of the website cannot be accessed. How do you open the debugging mode at this time?

Take a chestnut:

After doing some operations, I found that the website reported an error!

So I wanted to go into the background and open the debugging mode, but I found that the background could not enter!!

At this time, my mood is broken!!!???

 How can I force the debug mode (development mode) of zblog to be enabled when the background cannot be accessed? Page 3

What should I do? Do you want to restore the website backup?

Or change the database?

ZC_DEBUG_MODE is found in the config table, and b: 0 is changed to b: 1

Is this too unfriendly for ordinary users?

In fact, the solution is very simple

We found the zb_system support error.php file in the website directory.

Add the following code to the second line:

 $GLOBALS['option']['ZC_DEBUG_MODE']=1;

 How can I force the debug mode (development mode) of zblog to be enabled when the background cannot be accessed? Page 4

Refresh the webpage and find that the error message has been very detailed.

 How can I force the debug mode (development mode) of zblog to be enabled when the background cannot be accessed? Page 5

It turns out that I intentionally wrote a ";" in a section of code in the include.php file of the currently used theme.

Thus, the problem was solved.

As for the principle of this operation, no one should care.

Strictly speaking, this is not to open the debugging mode, but to make ZB output more detailed error code in a "cheat" way!

Don't mind so much, just use it!!!

Note: After the problem is solved, please delete the code you added.