Page 1 of 1

How To Hide/Remove/Disable [phpBB Debug] PHP Warning

Posted: Sun Aug 05, 2012 4:53 pm
by evepowr
Cant seem to do this one for the life of me. We are in the process of tracking down a stupid server error that is causing it to restart. So when the page is loading sometimes the rss feeds for example it will give a phpbb error. I know fixing the error is more important and we are working on that, its not a phpbb error but an error with the server.

Anyways im looking to stop it from showing. Here is what i have done so far.

1. Of course disabled debug in config.

Code: Select all

// @define('DEBUG', false);
// @define('DEBUG_EXTRA', false);
2. Disabled it at the php.ini level and it confirmed it in the admin panel of phpbb3

Code: Select all

display_errors	Off	Off
display_startup_errors	Off	Off
3. Removed the following from includes/template

Code: Select all

		if (defined('IN_ERROR_HANDLER'))
		{
			if ((E_NOTICE & error_reporting()) == E_NOTICE)
			{
				error_reporting(error_reporting() ^ E_NOTICE);
			}
		}
4. Added the following to my htaccess

Code: Select all

php_flag display_startup_errors off
php_flag display_errors off
php_flag html_errors off
I read how some people commented this out in common.php but i couldn't find it. Im using phpbb seo but i do have the latest version of phpbb and its not showing.

Code: Select all

// Report all errors, except notices
error_reporting(E_ALL ^ E_NOTICE); 

Re: How To Hide/Remove/Disable [phpBB Debug] PHP Warning

Posted: Sun Aug 05, 2012 4:59 pm
by T0ny
error_reporting() is on line 22 of includes/startup.php

Re: How To Hide/Remove/Disable [phpBB Debug] PHP Warning

Posted: Sun Aug 05, 2012 5:00 pm
by evepowr
Fixed it myself. For anyone wondering how to do this.

In common.php find

Code: Select all

if (file_exists($phpbb_root_path . 'config.' . $phpEx))
{
	require($phpbb_root_path . 'config.' . $phpEx);
}
Change it to:

Code: Select all

if (file_exists($phpbb_root_path . 'config.' . $phpEx))
{
	error_reporting(E_ALL ^ E_NOTICE ^ E_WARNING);
	require($phpbb_root_path . 'config.' . $phpEx);
}

Re: How To Hide/Remove/Disable [phpBB Debug] PHP Warning

Posted: Sun Aug 05, 2012 5:04 pm
by evepowr
GOOD NEWS EVERYONE

O duh it was in startup.php. I knew it was moved somewhere, i clearly need sleep. Well anyways did the same thing before but to startup.php which is a much cleaner move :). Thanks.