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

skill 3 years ago Lao Li next door Last edited at 10:49:54 on January 20, 2022

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.

If your application version is 1.7.2 and above, you don't need to look down.

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

The following is the old version:

Those familiar with Z-Blog know that 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, 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.


This article is written by@ Lao Li next door Published on June 25, 2021 on Yeluzi Blog , unless otherwise specified, all articles in this blog are original, please retain the source for reprinting.
comment (3)
 visitor
 Love sharing
Okay, good trick
· From the United States · reply
 Lao Wang
Successfully positioned and entered the backstage wrongly, thank Lao Li
· From Shenzhen, Guangdong Province · reply
 Li Yang's Blog
I learned that I always change the name of the plug-in or theme folder in FTP, then go into the background to start debugging and change the name back, switch to the wrong page to view the error code.
· From Liaoning Province · reply
Top