2012/03/27

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

在搬移空間後,如果有這個問題,是因為新的伺服器PHP版本是5.3.0以上版本的緣故。
如果你的程式版本沒有更新,使用的語法太舊。就會出現類似這樣的警告提示,wordpress的訊息:
Deprecated: Assigning the return value of new by reference is deprecated in /home/xxx/public_html/wp-settings.php on line 264

Deprecated: Assigning the return value of new by reference is deprecated in /home/xxx/public_html/wp-settings.php on line 266

Deprecated: Assigning the return value of new by reference is deprecated in /home/xxx/public_html/wp-settings.php on line 267

Deprecated: Assigning the return value of new by reference is deprecated in /home/xxx/public_html/wp-settings.php on line 284

Deprecated: Assigning the return value of new by reference is deprecated in /home/xxx/public_html/wp-includes/cache.php on line 36

Deprecated: Assigning the return value of new by reference is deprecated in /home/xxx/public_html/wp-includes/query.php on line 21

Deprecated: Assigning the return value of new by reference is deprecated in /home/exxx/public_html/wp-includes/theme.php on line 540
解決方法:
找到警告訊息的程式,將程式修改,例如上面的提示是wp-settings.php檔案的第264列
原本是以下,將&刪除
$wp_locale = & new WP_Locale();
修改成為
$wp_locale = new WP_Locale();

這樣應該就不會出現這個訊息了。

http://www.php.net/manual/en/oop4.newref.php

沒有留言:

發佈留言