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

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

Read and follow the rules, otherwise your posts will be closed
Modules
· Home
· FAQ
· Buy a Theme
· Advertising
· AvantGo
· Bookmarks
· Columbia
· Community
· Donations
· Downloads
· Feedback
· Forums
· PHP-Nuke HOWTO
· Private Messages
· Search
· Statistics
· Stories Archive
· Submit News
· Surveys
· Theme Gallery
· Top
· Topics
· Your Account
Who's Online
There are currently, 260 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
DEBUG MODE
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/www.yoursite.net/home/html69/modules/Forums/admin/admin_ug_auth.php

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

to

// Debug Level
//define('DEBUG', 1); // Debugging on
define('DEBUG', 1); // Debugging off
Powered by TOGETHER TEAM srl ITALY http://www.togetherteam.it - DONDELEO E-COMMERCE http://www.DonDeLeo.com - TUTTISU E-COMMERCE http://www.tuttisu.it
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.091 Seconds - 375 pages served in past 5 minutes. Nuke Cops Founded by Paul Laudanski (Zhen-Xjell)
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::