1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Moved to new server... getting PHP errors in WordPress... any PHP gurus here to help?!

Discussion in 'Blogging' started by Sente, Jan 8, 2012.

  1. Sente

    Sente Junior Member

    Joined:
    Sep 21, 2009
    Messages:
    193
    Likes Received:
    19
    On the top of every %$@# Wordpress blog I get:

    Deprecated: Assigning the return value of new by reference is deprecated

    How the hell do I get rid of it? It must have to do with going from a PHP4 to a PHP5 host and that some of my WP sites are OLD.

    THANK YOU!!!!! :) :)
     
  2. madoctopus

    madoctopus Supreme Member

    Joined:
    Apr 4, 2010
    Messages:
    1,249
    Likes Received:
    3,498
    Occupation:
    Full time IM
    Set error reporting to log errors but NOT display them. Or you can also set error reporting to not include notices but only errors. That's all in php.ini file
     
  3. kaidoristm

    kaidoristm Power Member

    Joined:
    Feb 13, 2009
    Messages:
    561
    Likes Received:
    726
    Occupation:
    Freelancer
    Location:
    Estonia
    Home Page:

    You answered your own question some of your wp templates need updating. Change templates or pay someone to fix them that's it.
     
  4. Sente

    Sente Junior Member

    Joined:
    Sep 21, 2009
    Messages:
    193
    Likes Received:
    19
    I can't find the php.ini file. :(

    I looked in wp-settings.php and there are error things I can adjust but I don't now how/which ones.
     
  5. orlandolongwood

    orlandolongwood Junior Member

    Joined:
    Aug 16, 2009
    Messages:
    137
    Likes Received:
    85
    Occupation:
    failed novelist
    Location:
    Austin, TX
    In your /wp-settings.php, replace:

    Code:
    if (defined(?WP_DEBUG?) and WP_DEBUG == true) {
    error_reporting(E_ALL);
    } else {
    error_reporting(E_ALL ^ E_NOTICE ^ E_USER_NOTICE);
    }
    with

    Code:
    if (defined(?WP_DEBUG?) and WP_DEBUG == true) {
    error_reporting(E_ALL);
    } else {
    error_reporting(0);
    }
    and add the following line to the top of wp-config.php:

    Code:
    error_reporting(0);
     
    • Thanks Thanks x 1
  6. Sente

    Sente Junior Member

    Joined:
    Sep 21, 2009
    Messages:
    193
    Likes Received:
    19
    YOU are a life saver! Thanks!

    In my file I have this:

    Code:
    // Add define('WP_DEBUG',true); to wp-config.php to enable display of notices during development.
    if (defined('WP_DEBUG') and WP_DEBUG == true) {
    	error_reporting(E_ALL);
    } else {
    	// Unicode Extension is in PHP 6.0 only or do version check when this changes.
    	if ( function_exists('unicode_decode') ) 
    		error_reporting( E_ALL ^ E_DEPRECATED ^ E_NOTICE ^ E_USER_NOTICE ^ E_STRICT );
    	else if ( defined( 'E_DEPRECATED' ) ) // Introduced in PHP 5.3
    		error_reporting( E_ALL ^ E_DEPRECATED ^ E_NOTICE ^ E_USER_NOTICE );
    	else
    		error_reporting(E_ALL ^ E_NOTICE ^ E_USER_NOTICE);
    }
    
    I just replaced all those elses with what you did, is this okay?

    Code:
    // Add define('WP_DEBUG',true); to wp-config.php to enable display of notices during development.
    if (defined('WP_DEBUG') and WP_DEBUG == true) {
    	error_reporting(E_ALL);
    } else {
    	// Unicode Extension is in PHP 6.0 only or do version check when this changes.
    	error_reporting(0);
    }
    
     
  7. orlandolongwood

    orlandolongwood Junior Member

    Joined:
    Aug 16, 2009
    Messages:
    137
    Likes Received:
    85
    Occupation:
    failed novelist
    Location:
    Austin, TX
    yeah, that should work. I think it will be quite awhile before you have most hosting providers moving to PHP 6 :)
     
    • Thanks Thanks x 1
  8. idoit

    idoit Registered Member

    Joined:
    Oct 27, 2011
    Messages:
    77
    Likes Received:
    42
    Home Page:
    and when your provider does that, come back for more ;)