Welcome to Centmin Mod Community
Register Now

Wordpress Nothing prints on WP_DEBUG

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

  1. JarylW

    JarylW Active Member

    213
    39
    28
    Jun 19, 2014
    Singapore
    Ratings:
    +99
    Local Time:
    3:24 PM
    Nvm figured it out.
     
  2. eva2000

    eva2000 Administrator Staff Member

    28,971
    6,575
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,758
    Local Time:
    5:24 PM
    Nginx 1.13.x
    MariaDB 5.5
    problem and solution was ? might help others :D
     
  3. JarylW

    JarylW Active Member

    213
    39
    28
    Jun 19, 2014
    Singapore
    Ratings:
    +99
    Local Time:
    3:24 PM
    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

    28,971
    6,575
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,758
    Local Time:
    5:24 PM
    Nginx 1.13.x
    MariaDB 5.5
  5. JarylW

    JarylW Active Member

    213
    39
    28
    Jun 19, 2014
    Singapore
    Ratings:
    +99
    Local Time:
    3:24 PM
    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

    28,971
    6,575
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,758
    Local Time:
    5:24 PM
    Nginx 1.13.x
    MariaDB 5.5
    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

    213
    39
    28
    Jun 19, 2014
    Singapore
    Ratings:
    +99
    Local Time:
    3:24 PM
    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

    28,971
    6,575
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,758
    Local Time:
    5:24 PM
    Nginx 1.13.x
    MariaDB 5.5
  9. JarylW

    JarylW Active Member

    213
    39
    28
    Jun 19, 2014
    Singapore
    Ratings:
    +99
    Local Time:
    3:24 PM
    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' );