WPLOGO

wordpress wp-login.php 368和380行错误解决

今天有一个朋友的WORDPRESS打开登录界面出现错误提示提示登录文件的368和380行错误(见文章最下侧)。
在我一再追问下,他跟我说他用UE(UltraEdit)对模板文件functions.php进行编辑后,另存为UTF-8格式(因为他在文件内写入了中文字),本来没有什么问题,但是他保存的UTF-8不对,应该保存为UTF-8无BOM的格式。他保存的UTF-8格式导致了这个错误的产生,具体原因,就是HEADER()语句前面不能输出任何字符,空格也不行,而单纯的UTF-8格式会导致插入一些看不见的空格(双字节),导致了这个错误。

Warning: Cannot modify header information - headers already sent by 
(output started at wordpress\wp-config.php:1) in 
wordpress\wp-login.php on line 
368

Warning: Cannot modify header information - headers 
already sent by (output started at wordpress\wp-config.php:1) in 
wordpress\wp-login.php on line 
380

在登录之后整个页面都报错,显示为

Warning: Cannot modify header information - headers 
already sent by (output started at wordpress\wp-config.php:1) in 
wordpress\wp-includes\pluggable.php on line 
680

Warning: Cannot modify header information - headers 
already sent by (output started at wordpress\wp-config.php:1) in 
wordpress\wp-includes\pluggable.php on line 
681

Warning: Cannot modify header information - headers 
already sent by (output started at wordpress\wp-config.php:1) in 
wordpress\wp-includes\pluggable.php on line 
682

Warning: Cannot modify header information - headers 
already sent by (output started at wordpress\wp-config.php:1) in 
wordpress\wp-includes\pluggable.php on line 876