LoginSignup
0
0

More than 3 years have passed since last update.

Wordpressでphpのデバッグをしたい

Posted at

wp-config.confのWP_DEBUGtrueに変更して以下を追加する。

wp-config.conf
define( 'WP_DEBUG', true );
if ( WP_DEBUG ) {
    define( 'WP_DEBUG_LOG', true );
    define( 'WP_DEBUG_DISPLAY', false );
    @ini_set( 'display_errors', 0 );    
}

あとは適当なphpファイルでerror_log()を使って出力する。

functions.php
error_log('this is debug.');

wp-content以下にdebug.logが出力されるので確認できる。

debug.log
[20-May-2020 00:00:00 UTC] this is debug.
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0