Assigning the return value of new by reference is deprecated

Posted: 6p in Wordpress

WordPress Deprecated: Assigning the return value of new by reference is deprecated /home/domainname/wordpress/wp-settings.php on line 512

when we have installed our wordpress we had old php version might be 4 or below php 5. as our server update php 4 to php 5 or more, this error start showing as our wordpress codes are php 4 compatible. so we have 2 options,

1, reinstall new fresh wordpress.

2. use below solution to avoid errors.

I think the better solution you can do the second one.

Solutions

You need to edit two php files,

domainname/wp-settings.php

search this code

if (defined(’WP_DEBUG’) and WP_DEBUG == true) {
error_reporting(E_ALL);
} else {
error_reporting(E_ALL ^ E_NOTICE ^ E_USER_NOTICE);
}

Replace with

if (defined(’WP_DEBUG’) and WP_DEBUG == true) {
error_reporting(E_ALL);
} else {
error_reporting(0);
}

now the second file

domainname/wp-config.php

may sure keep a backup of these files before make any change, may be it can stop working your entire website

just add this code at top of this file

error_reporting(0);

save the file and check the website the error will be done.

It’s worked for me 🙂
=====================================================================>

Advertisements
Comments
  1. Jisin says:

    awesome blog..

  2. get download says:

    Keep up the fantastic work , I read few articles on this internet site and I think that your website is real interesting and contains circles of good info .

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s