Turn off PHP error reporting

Protection Requirement:

BASIC

Skills/Resources:

>Install plugin or edit system files
>Plugin or Text editor

THE THREAT
PHP error reporting can provide potential hackers with the information they need to hack your system.

THE OBJECTIVE
Disable PHP error reporting.

PROPOSED SOLUTION
PHP error reporting (WP_DEBUG) is meant to help you identify bugs with your system but most of the time it is not needed.

Intentionally generating system errors is a technique used by hackers to get the system to display information that can be used to hack your system.

There are some plugins available that will disable PHP error reporting for you, or you can do it manually using the instructions in the MORE ADVANCED box.

https://wordpress.org/plugins/ninjafirewall/

MORE ADVANCED
The following instructions will disable PHP error reporting but remember that if you do have a problem and want to enable WP_DEBUG, you will have to comment out these lines for you to see debugging errors.

Edit the wp-config.php file and use either method placing the code top of the file.

Method 1:

define(‘WP_DEBUG’, false);

On some hosting (especially cheap shared hosts that force displaying PHP warnings and notices) this will not work and you need to use the following instead:

ini_set(‘log_errors’,’On’);
ini_set(‘display_errors’,’Off’);
ini_set(‘error_reporting’, E_ALL );
define(‘WP_DEBUG’, false);
define(‘WP_DEBUG_LOG’, true);
define(‘WP_DEBUG_DISPLAY’, false);

Method 2:

/** Sets up WordPress vars and included files. */
require_once(ABSPATH . ‘wp-settings.php’);

error_reporting(0);

NEED HELP?
If you need help implementing this and other security measures then Virtual Webmaster Services can help. Visit Virtual Webmaster Services

RESOURCES
none