If your site is experiencing issues that you think might be related to PHP issues, here’s how you turn on error reporting in WordPress:
Find line one below in wp-config.php
, comment it out, and add the rest below. This is meant to be done on a development site, in a local environment.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// define('WP_DEBUG', false); | |
define('WP_DEBUG', true); | |
define('WP_DEBUG_LOG', true); | |
define('WP_DEBUG_DISPLAY', false); | |
@ini_set('display_errors', 0); |
WordPress will now start logging errors in debug.log
file within /wp-content
directory.
Even if you don’t notice major errors with your site you can still often find warnings on deprecated code or other PHP issues.