Join the community today
Become a Member

Wordpress Nothing prints on WP_DEBUG

Discussion in 'Blogs & CMS usage' started by JarylW, Aug 2, 2016.

  1. JarylW

    JarylW Active Member

    216
    41
    28
    Jun 19, 2014
    Singapore
    Ratings:
    +103
    Local Time:
    10:47 AM
    Nvm figured it out.

     
  2. eva2000

    eva2000 Administrator Staff Member

    54,909
    12,240
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,811
    Local Time:
    12:47 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    problem and solution was ? might help others :D
     
  3. JarylW

    JarylW Active Member

    216
    41
    28
    Jun 19, 2014
    Singapore
    Ratings:
    +103
    Local Time:
    10:47 AM
    WP_DEBUG doesnt seem to print if
    Code:
    define('WP_HOME','http://example.com');
    define('WP_SITEURL','http://example.com');
    
    is used. It was a lazy way for me to move sites before. Anyone can confirm?
     
  4. eva2000

    eva2000 Administrator Staff Member

    54,909
    12,240
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,811
    Local Time:
    12:47 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
  5. JarylW

    JarylW Active Member

    216
    41
    28
    Jun 19, 2014
    Singapore
    Ratings:
    +103
    Local Time:
    10:47 AM
    This probably does the same as changing it at Settings -> General in wp-admin? Sometimes still need to replace all urls in database though..
     
  6. eva2000

    eva2000 Administrator Staff Member

    54,909
    12,240
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,811
    Local Time:
    12:47 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    Yes same as wp-admin update

    to replace all instances in database again from linked above how to, use wp-cli
    Code (Text):
    wp search-replace 'http://olddomain.com' 'http://newdomain.com' --skip-columns=guid
     
  7. JarylW

    JarylW Active Member

    216
    41
    28
    Jun 19, 2014
    Singapore
    Ratings:
    +103
    Local Time:
    10:47 AM
    Managed to get WP_Debug to work, but php errors seem to not show in /wp-content/debug.log

    Anyone managed to get it to show? Right now have to look only at /var/log/php-fpm/www-php.error.log

    This log is across all sites and gets super huge. I think having wordpress installs individually display php errors would be good; easier for debugging and for reporting bugs to plugin developers.

    I did it by adding
    Code:
    
    fastcgi_param PHP_VALUE "error_log=/home/nginx/domains/staging.mysite.com/public/wp-content/debug.log";
    to /usr/local/nginx/conf/php-wpsc.conf and appending -sitename as suffix (php-wpsc-mysite.com.conf).

    Then replace all php-wpsc.conf to php-wpsc-mysite.conf in all virtual conf of sites in /usr/local/nginx/conf/conf.d

    Not sure if this is the best way to do it though - seems more like a hack. Any advice?
     
    Last edited: Aug 9, 2016
  8. eva2000

    eva2000 Administrator Staff Member

    54,909
    12,240
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,811
    Local Time:
    12:47 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
  9. JarylW

    JarylW Active Member

    216
    41
    28
    Jun 19, 2014
    Singapore
    Ratings:
    +103
    Local Time:
    10:47 AM
    Yea - Got php error log per vhost that way - but still wp_debug does not want to log to a file despite setting in wp-config.php

    Code:
    define( 'WP_DEBUG', true );
    ini_set( 'display_errors', 1 );
    ini_set( 'log_errors', 1 );
    ini_set( 'error_log', dirname(__FILE__) . '/wp-content/wp-debug.log' );
    
     
  10. neverminder

    neverminder Member

    44
    3
    8
    Nov 23, 2017
    Ratings:
    +5
    Local Time:
    4:47 AM
    1.13.6
    10.0.33
    Ever managed to make it work? My wp-content/debug.log stays empty, no matter how many errors WP_Debug would display.