WordPress 网站出现 PHP Catchable fatal error: Object of class WP_Error could not be converted to string 错误的解决方法

某个客户的 WordPress 网站访问出现 The site is experiencing technical difficulties. 错误,我们通过网站根目录下的 error_log 文件看到了具体的报错:

[12-Jul-2019 07:59:59 UTC] PHP Catchable fatal error: Object of class WP_Error could not be converted to string in /home/xxx/public_html/wp-includes/rewrite.php on line 329

我们根据日志分析排查:其根本原因很可能是 WordPress 代码问题导致 WP_Error 对象被写入 MySQL 表。具体位置是在 wp_options 表中的 category_base 选项,如下图:

到这里,解决方法就非常简单了,只需要删除 category_base 中的全部内容并留空,网站即可恢复正常访问,如下图:

1 Star2 Stars3 Stars4 Stars5 Stars (无评分)
Loading...

分类:WordPress |

在线客服

QQ客服

微信客服