关闭PHP 5.3中不推荐使用的错误
问题描述:
我的服务器正在运行PHP 5.3,而我的WordPress安装正在向我吐出这些错误,导致我的session_start()中断.
My server is running PHP 5.3 and my WordPress install is spitting these errors out on me, causing my session_start() to break.
Deprecated: Assigning the return value of new by reference is deprecated in /home//public_html/hub/wp-settings.php on line 647
Deprecated: Assigning the return value of new by reference is deprecated in /home//public_html/hub/wp-settings.php on line 662
Deprecated: Assigning the return value of new by reference is deprecated in /home//public_html/hub/wp-settings.php on line 669
Deprecated: Assigning the return value of new by reference is deprecated in /home//public_html/hub/wp-settings.php on line 676
Deprecated: Assigning the return value of new by reference is deprecated in /home//public_html/hub/wp-settings.php on line 712
这很烦人,但是我不想关闭屏幕错误报告功能.如何禁用这些烦人的已弃用警告?
This is annoying, but I do not want to turn off on screen error reporting. How do I disable these bothersome deprecated warnings?
我正在运行WordPress 2.9.2.
I am running WordPress 2.9.2.
答
您可以通过调用以下函数在代码中进行操作.
You can do it in code by calling the following functions.
error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE);
或
error_reporting(E_ALL ^ E_DEPRECATED);