Last active
June 3, 2026 17:17
-
-
Save prappo/894fb83f6ffcce95138167c4fdaa3113 to your computer and use it in GitHub Desktop.
Enable WordPress debugging and map debug.log file for wp-env
This file contains hidden or 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
| { | |
| "plugins": ["."], | |
| "config": { | |
| "WP_DEBUG": true, | |
| "WP_DEBUG_LOG": true, | |
| "SCRIPT_DEBUG": true, | |
| "WP_DEBUG_DISPLAY": true, | |
| "WP_PHP_BINARY": "php" | |
| }, | |
| "mappings": { | |
| "wp-content/debug.log": "./debug.log" | |
| } | |
| } |
I had the same issue
Hi @greenworld, I use another way to fix it
"config": {
"WP_DEBUG": true,
"WP_DEBUG_DISPLAY": true,
"SCRIPT_DEBUG": false,
"WP_DEBUG_LOG": "/var/www/html/wp-content/plugins/[plugin-slug]/debug.log"
}
@greenworld @lbonomo Are you guys on Linux by any chance? I believe it has to do with mappings expecting a directory mapping, yet debug.log is a file.
Another fix is to move it inside a directory and map that instead.
{
"mappings": {
"./wp-content/logs": "./logs"
},
"config": {
"WP_DEBUG_LOG": "/var/www/html/wp-content/logs/debug.log"
}
}Thank you @dannyvankooten this helped !
👍
and yes, i'm on Linux (and wp-env uses docker under the hood)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank you for a useful config snippet
Mapping is not working properly for me (directory
./debug.logis created instead of file) to fix need to remove folder and create locally file./debug.logwith appropriate permissions