安装插件后WordPress损坏

时间:2015-12-11 08:22:16

标签: php wordpress

我安装了这个插件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,但仍然无法正常工作。

我怀疑它可能是数据库,但我发现问题是运气不好..任何人都可以帮忙吗?

2 个答案:

答案 0 :(得分:3)

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

一些可能的原因:

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

可能的解决方案:

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

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

我做了什么?

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

答案 1 :(得分:2)

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

意味着在某些文件中,在到达脚本结束之前,已经有一些文本被发送到浏览器。

<?php

检查该文件,在Pattern代码开始声明之前,文件开头可能有空格。

我在文件的开头没有空格,也许罪魁祸首是UTF BOM,你应该在文本编辑器的帮助下删除它,例如Notepad++可以选择这样做(编码 - &gt;转换为UTF-8)。