与PHP升级相关的WordPress错误

时间:2014-12-12 作者:antoccino

我主动提出在我的网络托管帐户上托管我堂兄的演员简介网站。他让人创建了一个wordpress网站并将其存储在我的帐户上。它在PhP 5.2上运行得很好,但我的主机提供商已经将其淘汰。现在,我被迫使用PhP 5.3或PhP 5.4,因此出现了许多错误。

如果有人知道是否/如何解决这个问题,请告诉我好吗?他依靠这个网站来获得工作,我很沮丧,因为我找不到答案,也无法自己解决。

使用PhP 5.4,我在页面内容上方发现以下错误:

Strict Standards: Declaration of Walker_Page::start_lvl() should be compatible with Walker::start_lvl(&$output) in /home/naumovski/tonynaumovskirotino.com/wp-includes/classes.php on line 576

Strict Standards: Declaration of Walker_Page::end_lvl() should be compatible with Walker::end_lvl(&$output) in /home/naumovski/tonynaumovskirotino.com/wp-includes/classes.php on line 576

Strict Standards: Declaration of Walker_Page::start_el() should be compatible with Walker::start_el(&$output) in /home/naumovski/tonynaumovskirotino.com/wp-includes/classes.php on line 576

Strict Standards: Declaration of Walker_Page::end_el() should be compatible with Walker::end_el(&$output) in /home/naumovski/tonynaumovskirotino.com/wp-includes/classes.php on line 576

Strict Standards: Declaration of Walker_PageDropdown::start_el() should be compatible with Walker::start_el(&$output) in /home/naumovski/tonynaumovskirotino.com/wp-includes/classes.php on line 593

Strict Standards: Declaration of Walker_Category::start_lvl() should be compatible with Walker::start_lvl(&$output) in /home/naumovski/tonynaumovskirotino.com/wp-includes/classes.php on line 687

Strict Standards: Declaration of Walker_Category::end_lvl() should be compatible with Walker::end_lvl(&$output) in /home/naumovski/tonynaumovskirotino.com/wp-includes/classes.php on line 687

Strict Standards: Declaration of Walker_Category::start_el() should be compatible with Walker::start_el(&$output) in /home/naumovski/tonynaumovskirotino.com/wp-includes/classes.php on line 687

Strict Standards: Declaration of Walker_Category::end_el() should be compatible with Walker::end_el(&$output) in /home/naumovski/tonynaumovskirotino.com/wp-includes/classes.php on line 687

Strict Standards: Declaration of Walker_CategoryDropdown::start_el() should be compatible with Walker::start_el(&$output) in /home/naumovski/tonynaumovskirotino.com/wp-includes/classes.php on line 710

Strict Standards: Redefining already defined constructor for class wpdb in /home/naumovski/tonynaumovskirotino.com/wp-includes/wp-db.php on line 58

Deprecated: Assigning the return value of new by reference is deprecated in /home/naumovski/tonynaumovskirotino.com/wp-includes/cache.php on line 99

Strict Standards: Redefining already defined constructor for class WP_Object_Cache in /home/naumovski/tonynaumovskirotino.com/wp-includes/cache.php on line 404

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

Deprecated: Assigning the return value of new by reference is deprecated in /home/naumovski/tonynaumovskirotino.com/wp-includes/theme.php on line 576
在PhP 5.3上,我遇到以下错误:

Deprecated: Assigning the return value of new by reference is deprecated in /home/naumovski/tonynaumovskirotino.com/wp-includes/cache.php on line 99

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

Deprecated: Assigning the return value of new by reference is deprecated in /home/naumovski/tonynaumovskirotino.com/wp-includes/theme.php on line 576

3 个回复
SO网友:Tom J Nowell

您的WordPress安装已过期。升级到最新版本(编写本文时为4.0.1)应该可以修复这些问题,同时修复数百个其他bug和安全问题。

作为补充说明,您应该始终保持PHP和WordPress安装为最新版本。选择PHP 5.4,并在可用时移动到5.5和5.6。它们修复了PHP中的安全问题,并带来了重大的速度改进。

SO网友:Matthew Campbell

WordPress的哪个版本?很晚了,我很累,但基本上,代码已经过时了。这个地方一定很古老。5.2于2006年发布,5.3于2009年发布。由于唯一改变的变量是PHP版本,我相信这就是。也许是时候重写了。

SO网友:Neil Robertson

Short Term Solution

根据以下答案:https://stackoverflow.com/a/9984309/1983389 您可以通过更改php来抑制警告消息。ini或。htaccess文件。

在php中。ini更改

error_reporting = E_ALL

error_reporting = E_ALL & ~E_NOTICE & ~E_STRICT

如果您没有访问php的权限。ini,您可以将其潜在地放在您的中。htaccess文件:

php_value error_reporting 30711

这是E\\u ALL值(32767)和删除E\\u STRICT(2048)和E\\u NOTICE(8)值。

听起来您已经检查过了,但是一些web主机控制面板允许您选择一个旧版本的PHP,这也可以解决这个问题。

Long Term Solution

从安全性的角度来看,显然最好是跟上WordPress和PHP的最新版本,希望上述短期解决方案能为您赢得一些时间来计划和执行所需的更新。

结束

相关推荐

Admin-Ajax.php, SSL, Non-SSL

我有一个反向代理背后的WordPress网站。该站点通过http,但wp admin区域除外,该区域位于https下。我们没有BasicAuth或任何运行在管理区域顶部的东西。我们的一个前端插件出现故障,因为它正在调用https://admin-ajax.php 浏览器似乎不喜欢这种行为。(如果有关系,URL字符串包含nonce)允许前端调用admin ajax的最佳方式是什么。php?我是否应该将所有对该文件的调用从https重定向到http?如果是,我如何做到这一点,同时仍然要求/wp admin下的