Select Page

To enable error logging, create an empty file named “php-errors.log”. Place it in a directory that is not publicly accessible (preferably outside your web root) and ensure it is writable by the web server. Then add the following code to wp-config.php:

@ini_set('log_errors', 'On');
@ini_set('error_log', '/full/path/to/php-errors.log');

By default, only fatal errors and warnings will be logged. To also log notices and other messages, enable the WP_DEBUG option by adding this code:

//Report all types of errors.
define('WP_DEBUG', true);
//Don't show errors to site visitors.
define('WP_DEBUG_DISPLAY', false);