You are missing our premiere tool bar navigation system! Register and use it for FREE!

•  Home •  Downloads •  Gallery •  Your Account •  Forums • 
Readme First
- Readme First! -

Read and follow the rules, otherwise your posts will be closed
· Home
· Buy a Theme
· Advertising
· AvantGo
· Bookmarks
· Columbia
· Community
· Donations
· Downloads
· Feedback
· Forums
· Private Messages
· Search
· Statistics
· Stories Archive
· Submit News
· Surveys
· Theme Gallery
· Top
· Topics
· Your Account
Who's Online
There are currently, 274 guest(s) and 0 member(s) that are online.

You are Anonymous user. You can register for free by clicking here
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
Web site engine's code is Copyright © 2002 by PHP-Nuke. All Rights Reserved. PHP-Nuke is Free Software released under the GNU/GPL license.
Page Generation: 0.260 Seconds - 326 pages served in past 5 minutes. Nuke Cops Founded by Paul Laudanski (Zhen-Xjell)
:: FI Theme :: PHP-Nuke theme by coldblooded ( ::