【问题标题】:WordPress corrupt after installing pluginWordPress安装插件后损坏
【发布时间】:2016-03-17 02:20:52
【问题描述】:

我安装了这个插件https://wordpress.org/plugins/wp-gallery-custom-links/,在安装过程中出现错误,在页面刷新之前我没有时间阅读。

现在我的媒体选择器根本没有加载。

我完全删除了插件,没有运气,现在我什至无法再访问 wp-admin。收到如下错误:

Warning: Cannot modify header information - headers already sent by (output started at /var/www/vhosts/xxxx.com/httpdocs/wp-content/themes/caroli/functions.php:1) in /var/www/vhosts/xxxx.com/httpdocs/wp-includes/pluggable.php on line 1196

Warning: Cannot modify header information - headers already sent by (output started at /var/www/vhosts/xxxxx.com/httpdocs/wp-content/themes/caroli/functions.php:1) in /var/www/vhosts/xxxx.com/httpdocs/wp-login.php on line 425

Warning: Cannot modify header information - headers already sent by (output started at /var/www/vhosts/xxxxxx.com/httpdocs/wp-content/themes/caroli/functions.php:1) in /var/www/vhosts/xxxxx.com/httpdocs/wp-login.php on line 438

Warning: Cannot modify header information - headers already sent by (output started at /var/www/vhosts/xxxxxx.com/httpdocs/wp-content/themes/caroli/functions.php:1) in /var/www/vhosts/xxxxxx.com/httpdocs/wp-login.php on line 425

Warning: Cannot modify header information - headers already sent by (output started at /var/www/vhosts/xxxx.com/httpdocs/wp-content/themes/caroli/functions.php:1) in /var/www/vhosts/xxxxxx.com/httpdocs/wp-login.php on line 438

Warning: Cannot modify header information - headers already sent by (output started at /var/www/vhosts/caroli.hosterspace.com/httpdocs/wp-content/themes/caroli/functions.php:1) in /var/www/vhosts/xxxxxxx.com/httpdocs/wp-includes/pluggable.php on line 925

Warning: Cannot modify header information - headers already sent by (output started at /var/www/vhosts/xxxxxxxxx.com/httpdocs/wp-content/themes/caroli/functions.php:1) in /var/www/vhosts/xxxxx.com/httpdocs/wp-includes/pluggable.php on line 926

Warning: Cannot modify header information - headers already sent by (output started at /var/www/vhosts/xxxxxx.com/httpdocs/wp-content/themes/caroli/functions.php:1) in /var/www/vhosts/xxxxxx.com/httpdocs/wp-includes/pluggable.php on line 927

Warning: Cannot modify header information - headers already sent by (output started at /var/www/vhosts/xxxxxxxx.com/httpdocs/wp-content/themes/caroli/functions.php:1) in /var/www/vhosts/xxxxxx.com/httpdocs/wp-includes/pluggable.php on line 1196

我已经下载了 wordpress 的新副本并替换了 wp-admin 文件夹、wp-includes 文件夹、wp-config.php 文件、wp-login.php 文件。

我尝试在插件文件夹上更改名称,但仍然不起作用,我尝试删除我的主题以访问 wp-admin,但仍然不起作用。

我怀疑它可能是数据库,但我运气不好找到问题..有人可以帮忙吗?

【问题讨论】:

  • functions.php 的开头是什么样的?比如前 10 行。
  • 选择其他主题有帮助吗?

标签: php wordpress


【解决方案1】:

Cannot modify header information - headers already sent by

表示在到达脚本末尾之前,某个文件中已经有一些文本发送到浏览器。

output started at /var/www/vhosts/xxxx.com/httpdocs/wp-content/themes/caroli/functions.php:1

检查该文件,<?php 代码开始声明之前的文件开头可能有一个空格。

我在文件的开头没有空格,可能罪魁祸首是UTF BOM,你应该在文本编辑器的帮助下删除它,例如Notepad++有一个选项可以做到这一点(编码->转换为 UTF-8)。

【讨论】:

  • 不幸的是,问题并非如此。我检查了空格,我已经转换为 UTF-8,仍然没有运气
  • 嗯,你提供的错误日志肯定指向 caroli/functions.php 文件的第 1 行。你碰巧有那个文件的备份吗?
【解决方案2】:

我已经多次遇到这个问题,正如 Vaviloff 所说,在文件开头(<?php 之前)放置一个空格是您要查找的内容。

一些可能的原因:

  • 一个损坏的插件
  • 损坏的主题
  • 您的 Wordpress 安装被入侵(您会在文件开头看到一些 eval())

可能的解决方案:

  • 检查相关文件:/var/www/vhosts/xxxx.com/httpdocs/wp-content/themes/caroli/functions.php:1 并删除<?php之前的空格
  • 禁用您已安装的最新插件以查看它是否有任何作用
  • 运行一个像 Wordfence 这样的插件(以防万一),它会扫描你的文件 比您手动操作更快并检查与 WP 核心的差异或查找可疑代码(免费版本可以完成所有这些操作)

编辑: 我刚刚看到您无法访问 wp-admin。这很棘手,但我曾经遇到过同样的问题。好吧,这是一次入侵(由于一个过时的插件)。

我做了什么?

  • 我的主题的备份
  • 我的数据库的备份
  • 我上传的备份
  • 已安装插件列表
  • 已更改所有密码
  • 删除了服务器的所有相关部分(所有备份之后)
  • 重新安装新的 WP
  • 已恢复主题/数据库/上传/插件(安装插件时检查插件的最新更新)
  • 安装 Wordfence,以防万一

【讨论】:

  • 您好,我无法联系 wp-admin,因此无法运行任何插件。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2012-10-13
  • 2018-09-13
  • 1970-01-01
相关资源
最近更新 更多