Some hosting environments set wp-config.php to read-only. WP Debug Toolkit (WPDT) includes automatic permission elevation that temporarily makes the file writable, applies changes, and restores the original permissions.
WPDT writes to wp-config.php when you:
WP_DEBUG, WP_DEBUG_LOG, WP_DEBUG_DISPLAY, SAVEQUERIES)WP_MEMORY_LIMITOn most hosts, wp-config.php is writable by the PHP process and no elevation is needed. On hosts with restrictive file permissions, the write fails without elevation.
When WPDT detects that wp-config.php is not writable, it attempts:
0444)0644) using PHP’s chmod()This happens within a single PHP request. The file is writable only for the duration of the write operation.
Permission elevation works when:
wp-config.php (same user), orchmod() on the fileThis covers most shared hosting, VPS, and dedicated server configurations where the web server user owns the WordPress files.
Permission elevation fails when:
chmod() requires ownership or root privilegeswp-config.php modifications regardless of file permissions. This is not a permission issue that chmod can solve.When elevation fails, WPDT reports the error in the admin dashboard: “Failed to enable debugging. Check wp-config.php permissions.”
WPDT adds a wp-config.php writability check to the Site Health page (Debug Toolkit > Site’s Health). The check reports:
wp-config.php is currently writableUse the Test Write Access button to perform a non-destructive test. WPDT checks whether the file is writable with is_writable() and tests whether chmod() can elevate permissions. It does not write to the file. This confirms whether the toggle switches will work on your host.
| Host | Permission elevation | Notes |
|---|---|---|
| Most shared hosting | Works | PHP typically owns WordPress files |
| VPS / dedicated | Works | Standard ownership model |
| GridPane | Not needed | WPDT writes to secure-debug.php, which is writable |
| Flywheel | Does not work | Platform-level lockdown; use Flywheel’s debug toggle |
If permission elevation fails and you cannot use a hosting dashboard to toggle debug constants:
wp-config.phpdefine('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);
define('WP_DEBUG_DISPLAY', false);
After enabling debug logging manually, all other WPDT features (viewer, log reading, query monitoring, notifications) work normally.