Wordpress Deprecated: Assigning the return value of new by reference is deprecated
WordPress Deprecated: Assigning the return value of new by reference is deprecated /home/root/wordpress/wp-settings.php on line 512
These days i have seen many wordpress blog sites showing this sort of error, even google have indexed many domain pages with this error looks very funny
web owner search this error solution online, even few days back our website also showing same error, and i have to find out solution to fix it too.
Here i have bring you fast and exact solution read below and fix it.
Why this happened suddenly ?
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 2 solution is better as no body want to have huge pain to install new fresh copy, or loss data.
so why waiting for here is the solution.
Solutions
You need to edit 2 php files,
root/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 2nd file
root/wp-config.php
may sure keep a back of this file before make any change, it can stop working your entire website
just add this code at top of this file
error_reporting(0);
that is it.













August 17th, 2011 at 7:00 pm
Will wordpress have an update for this pretty soon?
December 23rd, 2011 at 8:25 am
I do everything and site is down
January 18th, 2012 at 8:49 am
Solved my problem. Huge!
Thanks a lot.