Toggle menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Debugging Options

From John's Wiki
Revision as of 10:29, 4 October 2023 by Admin (talk | contribs) (Created page with "== WordPress Debugging == Edit the site's '''wp-config.php''' file to enable WordPress debugging. define( 'WP_DEBUG', true ); define( 'WP_DEBUG_DISPLAY', false ); define( 'WP_DEBUG_LOG', true ); That will prevent errors from being displayed on the site and instead log them to a '''wp-content/debug.log''' file. == PHP Debugging == === Via .user.ini or php.ini === display_errors = on To log errors to a '''php-debug.log''' file use the following syntax instead....")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

WordPress Debugging

Edit the site's wp-config.php file to enable WordPress debugging.

define( 'WP_DEBUG', true );
define( 'WP_DEBUG_DISPLAY', false );
define( 'WP_DEBUG_LOG', true );

That will prevent errors from being displayed on the site and instead log them to a wp-content/debug.log file.

PHP Debugging

Via .user.ini or php.ini

display_errors = on

To log errors to a php-debug.log file use the following syntax instead.

log_errors = on
error_log = ~/php-debug.log

Via PHP Code

ini_set('display_errors','1');
ini_set('display_startup_errors','1');
error_reporting (E_ALL);