解决Wordpress报错“Warning: Cannot modify header information”

王朝学院·作者佚名  2016-08-22
窄屏简体版  字體: 小  |  中  |  大  |  超大  

博客停了,WordPRess后台登陆报错,wp-login.php登陆页面出错,出现“Warning: Cannot modify header information – headers already sent by ……”这样的错误,

Warning: Cannot modify header information – headers already sent by (output started at G:Program FilesAppServ2wwwYeah20110213wp-contentthemesmonoChromefunctions.php:216) in G:Program FilesAppServ2wwwYeah20110213wp-login.php on line 335

Warning: Cannot modify header information – headers already sent by (output started at G:Program FilesAppServ2wwwYeah20110213wp-contentthemesmonochrome functions.php:216) in G:Program FilesAppServ2wwwYeah20110213wp-login.php on line 347

Warning: Cannot modify header information – headers already sent by (output started at G:Program FilesAppServ2wwwYeah20110213wp-contentthemesmonochrome functions.php:216) in G:Program FilesAppServ2wwwYeah20110213wp-login.php on line 349

虽然以前也出现过,但是过一段时间可以登陆成功,影响不大,主要是虚拟主机的问题,等服务器那边好了就好了。这次完全无法登陆后来了,查了一下午, 网上有好多网友遇到类似的、一样的问题,答案、方法几乎都千篇一律,说修改php.ini文件或者说是代码编码问题,什么如果使用UTF-8格式的,要保 存问无BOM的UTF-8格式。

这些都试过还是无用,最后在查看所用模板文件夹中的functions.php文件时发现了问题所在:

上图是functions.php文件的结束行,最后一个php标识符“?>”后有两空白行215、216,问题就是它们所致。删除即可!

如果还是出现“Warning: Cannot modify header information – headers already sent by”这样的提示,不要紧,它提示的错误个数是不是和刚才不同了,你再仔细找找functions.php文件的开头处“。

看吧,讨厌的“Warning: Cannot modify header information ……”没有了吧

原文:耶网博客http://www.yeah2.com/?p=919

 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
 
© 2005- 王朝網路 版權所有 導航