How to disable DEBUG mode

26.7. How to disable DEBUG mode

You may have already come across those errors that enter automatically a DEBUG mode and output a more descriptive message of what happened (we saw how to do this ourselves in Section 3.9.23):

General Error
Couldn't update private forum permissions
SQL Error : 1064 You have an error in your SQL syntax near ' 1)' at line 2
INSERT INTO nuke_bbauth_access (forum_id, group_id, auth_mod) VALUES (1, , 1)
Line : 425
File : /web/htdocs/

By the way, this is the error discussed in Section 3.9.14. You may not want to show so many details to your users and wish you could disable the DEBUG mode. But to disable the DEBUG mode, you have first to find where to do it:

In cases like this, search is your friend (see Can I disable the DEBUG mode): search for DEBUG in all texts of all files in all subdirectories of a PHP-Nuke installation. You will get a handful of lines:

/usr/bin/find ./ -type f -print0 | /usr/bin/xargs -0 /usr/bin/grep DEBUG
./includes/constants.php://define('DEBUG', 1); // Debugging on
./includes/constants.php:define('DEBUG', 1); // Debugging off
./includes/functions.php:       if ( DEBUG && ( $msg_code == GENERAL_ERROR ||
$msg_code == CRITICAL_ERROR ) )
./includes/functions.php:       // Add on DEBUG info if we've enabled debug mode 
and this is an error. This
./includes/functions.php:       // prevents debug info being output for general 
messages should DEBUG be
./includes/functions.php:       if ( DEBUG && ( $msg_code == GENERAL_ERROR || 
$msg_code == CRITICAL_ERROR ) )
./includes/functions.php:                       $msg_text = $msg_text . '<br />
<br /><b><u>DEBUG MODE</u></b>' . $debug_text;
./modules/WebMail/pop3.php:        var $DEBUG=0;
./modules/WebMail/pop3.php:                if ($this->DEBUG) echo "<b>Sending 
Command: </b>".$command."<br>";flush();
./modules/WebMail/pop3.php:                        if ($this->DEBUG) echo "<b>
Result OK: </b><br>";flush();
./modules/WebMail/pop3.php:                 if ($this->DEBUG) echo "<b>
Openning Connection to: </b>".$this->hostname."<br>";flush();
./modules/WebMail/pop3.php:                if ($this->DEBUG) echo "<b>
Connection opened </b><br>";flush();

It is clear that the DEBUG constant is set in includes/constants.php (see the first two lines of the above results) and is used in the rest of the files.

Thus, to disable DEBUG mode, you only need to edit includes/constants.php and change

// Debug Level
define('DEBUG', 1); // Debugging on
//define('DEBUG', 1); // Debugging off


// Debug Level
//define('DEBUG', 1); // Debugging on
define('DEBUG', 1); // Debugging off

Site Info v2.2.2

Last SeenLast Seen
  • FireATST
  • neralex
Server TrafficServer Traffic
  • Total: 379,178,808
  • Today: 32,486
Server InfoServer Info
  • Mar 24, 2019
  • 04:25 pm CET