Enable the WordPress debug log without displaying errors
find wordpress errors | enable wp_debug | turn on debug.log wordpress | find cause of white screen | wp-cli | debug | troubleshootingCaution: This command changes the system. Understand what it does before you run it.
wp config set WP_DEBUG true --raw --path=/var/www/vhosts/example.com/httpdocs && wp config set WP_DEBUG_LOG true --raw --path=/var/www/vhosts/example.com/httpdocs && wp config set WP_DEBUG_DISPLAY false --raw --path=/var/www/vhosts/example.com/httpdocsSets three constants in wp-config.php: debug mode on, logging to wp-content/debug.log, no display in the browser. This captures PHP errors and warnings on live sites without exposing paths or messages to visitors. --raw makes sure true and false are written without quotes.
Note: By default, debug.log is publicly accessible and grows quickly. After troubleshooting, set WP_DEBUG back to false and delete the file.
Also searched as
- find wordpress errors
- enable wp_debug
- turn on debug.log wordpress
- find cause of white screen