wp-config.php, set WP_DEBUG to true, enable WP_DEBUG_LOG, and reload the page. The page stays blank, and wp-content/debug.log is either empty or was never created. Debug mode seems to be on, yet nothing records the error. In most cases PHP is still writing the error somewhere. It just isn't writing to the file WordPress asked for.
This piece is written as a post-mortem of that pattern. It does not describe one specific incident. It follows the usual sequence: what the failure looks like, how the investigation tends to go, the point where the cause becomes clear, how to get the error on screen today, and what to change so the next white screen takes minutes to diagnose.
What the failure looked like
display_errors is off. Newer WordPress versions often catch the fatal and show the 'critical error' message instead. If the failure happens early, or the handler itself breaks, you still get a blank page or a bare HTTP 500.
The immediate impact is simple: the frontend, wp-admin, or both stop working, and nobody can see why. Customers often say the debug setting is broken. It isn't. The constants are a request to PHP, and several layers below WordPress can override that request.
How the investigation usually goes
PHP
// Place above the line: /* That's all, stop editing! */
// and above: require_once ABSPATH . 'wp-settings.php';
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );- Duplicate definitions. Many
wp-config.phpfiles already containdefine( 'WP_DEBUG', false );near the top. If you add a seconddefinefurther down, the first one wins. PHP only issues a warning about the duplicate, and that warning goes to the log you can't find. - Defined too late. WordPress reads these constants in
wp_debug_mode(), which runs insidewp-settings.php. Adefineplaced after therequire_onceline arrives after the decision has been made. - Wrong file. WordPress can load
wp-config.phpfrom the directory above the install. Some deployments also keep a staging copy next to production. Check that the document root and the file you edited belong to the same site. - Cached config. If OPcache runs with
opcache.validate_timestamps=0, PHP keeps serving the compiled old version ofwp-config.phpuntil OPcache is reset or PHP-FPM is reloaded.
WP_DEBUG_LOG set to true, the target is wp-content/debug.log. The PHP process must be able to create that file, so the user PHP runs as needs write access to wp-content. That user depends on the stack. On per-account setups (PHP-FPM pools per user, suEXEC, LSAPI) it is usually the account user. On a plain single-site VPS it is often www-data or nginx. A file owned by root, or a directory without write permission for the PHP user, means PHP silently fails to open the log.
BASH
# Read-only checks, run from the WordPress root
grep -n 'WP_DEBUG' wp-config.php
ls -ld wp-content
ls -l wp-content/debug.log
# Debian/Ubuntu PHP-FPM layout; paths differ on RHEL, cPanel, and LiteSpeed
grep -Rn 'error_log\|log_errors\|disable_functions' /etc/php/*/fpm/wp-content is writable, most investigations stall at this point. The next step is where the cause usually shows up.
Where the log was really going
wp_debug_mode() it calls ini_set() to turn on log_errors and to point error_log at debug.log. PHP then does the writing. Several things can make that ini_set() call fail without any visible error:
php_admin_valuein the FPM pool. A PHP-FPM pool (the group of PHP worker processes serving a site) can setphp_admin_value[error_log]andphp_admin_flag[log_errors]. Values set with theadminvariants cannot be changed byini_set()at runtime. WordPress asks, PHP refuses, and errors keep going to the pool's log.ini_setindisable_functions. Some hardened setups disable it entirely.open_basedirrestrictions. These limit which paths PHP can open. A custom log path outside the allowed list fails.- The error happens before WordPress loads. A syntax error in
wp-config.phpitself stops PHP before any constant takes effect. That error can only appear in the server-level log.
php -i on the command line use the CLI configuration, which often differs from the pool serving the site. A small standalone file, which does not load WordPress and so cannot hit the same fatal, tells you what the web PHP really sees:
PHP
<?php
// Temporary diagnostic. Use a random filename and delete it right after.
header( 'Content-Type: text/plain' );
echo 'SAPI: ' . php_sapi_name() . PHP_EOL;
echo 'log_errors: ' . var_export( ini_get( 'log_errors' ), true ) . PHP_EOL;
echo 'error_log: ' . var_export( ini_get( 'error_log' ), true ) . PHP_EOL;
echo 'open_basedir: ' . var_export( ini_get( 'open_basedir' ), true ) . PHP_EOL;
echo 'disable_functions: ' . ini_get( 'disable_functions' ) . PHP_EOL;
$r = @ini_set( 'error_log', __DIR__ . '/wp-content/debug.log' );
echo 'ini_set error_log result: ' . var_export( $r, true ) . PHP_EOL;ini_set returns false, something above WordPress has locked error_log, and the error_log line shows where errors are actually going. If error_log is empty, PHP is sending errors to its default destination. Under FPM that is typically the FPM log or the web server's error log, depending on settings such as catch_workers_output.
Getting the error in front of you today
- Open the path from the
error_logresult above, or thephp_admin_value[error_log]value in the site's pool file. - If that is empty, check the PHP-FPM service log and the web server error log for the vhost. Search for
PHP Fatal errororUncaught, and make sure the timestamp matches your page reload. - On cPanel and similar panels, the per-domain error log or an
error_logfile in the site directory is often the place to look. The exact location depends on the panel and handler, so check its documentation or the vhost config.
WP_DEBUG_DISPLAY to true so the error prints in the browser. This only works if display_errors isn't also locked at pool level. It also shows paths to visitors, so switch it back off as soon as you have the message.
Making log location predictable
ini_set() succeeds.
Give each site a PHP error log that the pool controls and the site user can write to, and keep it outside the web root. If the pool uses php_admin_value[error_log], treat that file as the real log and write its path in your runbook. If you want WordPress to manage its own file, set WP_DEBUG_LOG to a full path outside wp-content (supported in newer WordPress versions), make sure open_basedir allows that path, and don't lock error_log in the pool for that site. Either approach works. Mixing them is what produces the empty debug.log.
A few habits help. The default wp-content/debug.log is reachable over HTTP unless the web server blocks it, so don't leave logging pointed there on a live site. Put the log under logrotate or the panel's rotation. Turn WP_DEBUG back off after the incident.
For support staff the rule of thumb is short. When debug.log is empty, don't keep editing wp-config.php. Ask PHP-FPM where it is logging, check whether ini_set is allowed to change that, and read that file. The fatal error is almost always already there.