I'm looking to toggle the WP_DEBUG value within a WP-CLI script. Is there any option doing so AFTER the wp-config.php file was created?
(I know we can add extra PHP when creating the wp-config.php file, but once that's done, is there a way to turn off the WP_DEBUG state during the script?)
Thanks.
Woohoo! Native support added since WP-CLI version 1.5 -
https://developer.wordpress.org/cli/commands/config/set/
Example:
# Set the WP_DEBUG constant to true.
$ wp config set WP_DEBUG true --raw
To extend on @tlt2w answer posted above, I'm using this combo:
wp config set --raw WP_DEBUG true
wp config set --raw WP_DEBUG_LOG true
wp config set --raw WP_DEBUG_DISPLAY false
# show logs:
# clear; tail -f wp-content/debug.log -n0
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With