首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >关闭PHP 5.3中的弃用错误

关闭PHP 5.3中的弃用错误
EN

Stack Overflow用户
提问于 2010-05-10 23:12:12
回答 7查看 245K关注 0票数 133

我的服务器正在运行PHP5.3,而我的WordPress安装将这些错误传递给我,导致我的session_start()中断。

代码语言:javascript
复制
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

这很烦人,但我不想关闭屏幕上的错误报告。如何禁用这些讨厌的不推荐使用的警告?

我运行的是WordPress 2.9.2。

EN

回答 7

Stack Overflow用户

回答已采纳

发布于 2010-05-10 23:14:01

您可以通过调用以下函数在代码中完成此操作。

代码语言:javascript
复制
error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE);

代码语言:javascript
复制
error_reporting(E_ALL ^ E_DEPRECATED);
票数 221
EN

Stack Overflow用户

发布于 2010-08-21 17:22:10

我需要调整它来适应

代码语言:javascript
复制
error_reporting = E_ALL & ~E_DEPRECATED
票数 24
EN

Stack Overflow用户

发布于 2012-02-24 15:38:01

要只获取那些导致应用程序停止工作的错误,请使用:

代码语言:javascript
复制
error_reporting(E_ALL ^ (E_NOTICE | E_WARNING | E_DEPRECATED));

这将停止显示通知、警告和不推荐使用的错误。

票数 24
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/2803772

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档