PHP弃用的错误不会在WordPress仪表板上消失 [英] PHP Deprecated errors won't disappear on WordPress Dashboard

查看:178
本文介绍了PHP弃用的错误不会在WordPress仪表板上消失的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

TL; DR:我们服务器上的PHP升级导致WordPress中出现了一堆过时的错误,尝试了许多修复程序,但这些错误不会消失.

TL;DR : Upgraded PHP on our server which caused a bunch of Deprecated errors to appear in WordPress, tried a number of fixes but the errors won't go away.

PHP版本:5.3.10 WordPress版本:3.3.2

PHP Version: 5.3.10 WordPress Version: 3.3.2

我的WordPress安装程序已经启动并运行了一段时间,没有任何投诉.

I have a WordPress installation that has been up and running for a little while now, with no complaint.

这周,我们将服务器上的PHP升级到5.3.10,更新后,WordPress仪表板开始填充以下错误:

This week, we upgraded PHP on the server to 5.3.10, after the update, the WordPress Dashboard began filling up with errors like this:

Deprecated: Assigning the return value of new by reference is deprecated in /home/random/public_html/wp-includes/class-simplepie.php on line 738

  • 传入链接
  • WordPress博客
  • 插件

根据WordPress论坛上许多帖子的建议,我禁用了文件级别的错误报告(通过将error_reporting(0)添加到wp-config.php和/或其他文件的顶部)并使用PHP .ini. Phpinfo确认error_reporting = 0.

As advised by a number of posts around the WordPress forums, I disabled error reporting both at a file level (by adding error_reporting(0); to the top of wp-config.php and/or other files) and using PHP.ini. Phpinfo confirms that error_reporting = 0.

这无效,警告仍显示在仪表板上.

This had no effect, with the warnings still showing up on the dashboard.

我尝试禁用所有插件,并恢复为默认主题(目的是依次启用每个插件,以查看其中一个是否引起了问题),但错误继续出现.

I tried disabling all of my plugins and reverting to the default theme (with a mind to enable each one in turn to see if one of them was causing the issue) but the errors continued to appear.

接下来,我没有处理症状,而是去寻找是否可以解决问题的原因.

Next, instead of treating the symptom, I went to see if I could fix the cause of the issue.

使用Simplepie获取过时的错误

通过引用分配new的返回值是不推荐使用

指向class-simplepie.php,其中包含一些过时的语法.

pointed to class-simplepie.php having some out of date syntax inside.

在我的文本编辑器中使用查找/替换,我交换了166个

Using find/replace in my text editor I swapped all 166 instances of

=& new

对于

= new

而且我仍然在仪表板上看到错误.

And I am still seeing errors on my dashboard.

据我所知,应该没有要报告的错误,如果有,则无论如何都不会出现.

So, as far as I can see, there should be no errors to report, and if there were, they shouldn't be showing up anyway.

Wordpress不在调试模式下运行.

Wordpress is not running in debug mode.

可以在这里找到我的phpinfo的粘贴: http://pastebin.com/Pk68sDL1 (如果有)对任何人都有用.

A paste of my phpinfo can be found here: http://pastebin.com/Pk68sDL1 if it is of any use to anyone.

不确定下一步如何尝试.任何提示,不胜感激.

Not sure what to try next. Any tips much appreciated.

D

推荐答案

我今天遇到了完全相同的问题,我还尝试了列出的所有解决方案.最终我意识到,更换后

I was having the exact same problem today and I also tried all of the solutions you listed. Eventually I realized that after I replaced

=& new

使用

= new

在class-simplepie.php中,我还需要重新加载仪表板中的模块.只是刷新浏览器页面,甚至隐藏模块然后再次显示它,似乎都不会发生.

in class-simplepie.php, I also needed to reload the modules in the dashboard. This doesn't seem to happen when you just refresh the browser page, or even hide the module and then show it again.

因此,我突出显示了仪表板上的传入链接"模块,然后单击配置".我将RSS feed的URL更改为其他任何名称(google.com),点击Submit,它起作用了.刷新该模块,而class-simplepie.php中不再存在错误.对Wordpress Blog模块进行了相同的操作,并且也有效.

So I highlighted the Incoming Links module on the Dashboard and clicked Configure. I changed the RSS feed URL to anything else (google.com), hit Submit, and it worked. Refreshed that module with no more deprecated errors from class-simplepie.php. Did the same for the Wordpress Blog module and that also worked.

我唯一不知道的是如何刷新插件模块.它没有配置选项,我无法像其他选项一样重新加载.

The only thing I cannot figure out is how to refresh the Plugins module. It doesn't have a Configure option and I can't get it to reload like the others.

插件模块现在也可以工作.只是需要时间来重置.

Plugins module works now as well. Just needed time to reset.

这篇关于PHP弃用的错误不会在WordPress仪表板上消失的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆