Skip to content

emka.web.id

Menu
  • Home
  • Indeks Artikel
  • Tutorial
  • Tentang Kami
Menu

How to Enable Debugging on WordPress

Posted on May 20, 2012 by Syauqi Wiryahasana
By default, WordPress debugging is turned off, so to enable it, open wp-config.php (tip: make a backup copy of this file that you can revert to later if needed) in the root of your WordPress installation and look for this line: define('WP_DEBUG', false); Replace that line with the following: // Turns WordPress debugging on define('WP_DEBUG', true); // Tells WordPress to log everything to the /wp-content/debug.log file define('WP_DEBUG_LOG', true); // Doesn't force the PHP 'display_errors' variable to be on define('WP_DEBUG_DISPLAY', false); // Hides errors from being displayed on-screen @ini_set('display_errors', 0); With those lines added to your wp-config.php file, debugging is fully enabled. Here’s an example of a notice that got logged to /wp-content/debug.log for using a deprecated function: [15-Feb-2011 20:09:14] PHP Notice: get_usermeta is deprecated since version 3.0! Use get_user_meta() instead. in C:\Code\Plugins\wordpress\wp-includes\functions.php on line 3237 With debugging enabled, keep a close eye on /wp-content/debug.log as you develop your plugin. Doing so will save you, your users, and other plugin developers a lot of headaches.
Seedbacklink

Recent Posts

TENTANG EMKA.WEB>ID

EMKA.WEB.ID adalah blog seputar teknologi informasi, edukasi dan ke-NU-an yang hadir sejak tahun 2011. Kontak: kontak@emka.web.id.

©2024 emka.web.id Proudly powered by wpStatically