2012-02-06 54 views
5

错误发送了头:错误 - 警告:不能更改头信息 - 已经

Warning: Cannot modify header information - headers already sent by (output started at /home/ya3mblog/public_html/wp-login.php:59) in /home/ya3mblog/public_html/wp-includes/pluggable.php on line 866

website: ipublisharticles.com Error is at: ipublisharticles.com/wp-login.php?action=register

它防止使用正确的方法用户注册。

回答

3

How_do_I_solve_the_Headers_already_sent_warning_problem? > FAQ Troubleshooting « WordPress Codex

(This error) is usually because there are spaces, new lines, or other stuff before an opening <?php tag or after a closing ?> tag, typically in wp-config.php.

打开一个纯文本编辑器(如记事本或BBEdit中)的文件,并清除出空白。检查第一个字符是<?php ,最后一个字符不是PHP结束标记结束标记?>后面没有空行或空格。 (仅供参考,一个PHP文件可以罚款,而不关闭?>标签上运行。)

保存时,应确保文件的编码不是UTF-8 BOM,但简单的UTF-8或任何不带BOM后缀。

和:

This could be true about some other file too, so please check the error message, as it will list the specific file name where the error occurred. Replacing the faulty file with one from your most recent backup or one from a fresh WordPress download is your best bet.

If the error message states: Warning: Cannot modify header information - headers already sent by (output started at /path/blog/wp-config.php:34) in /path/blog/wp-login.php on line 42 , then the problem is at line #34 of wp-config.php, not line #42 of wp-login.php. In this scenario, line #42 of wp-login.php is the victim. It is being affected by the excess whitespace at line #34 of wp-config.php.

If the error message states: Warning: Cannot modify header information - headers already sent by (output started at /path/wp-admin/admin-header.php:8) in /path/wp-admin/post.php on line 569 , then the problem is at line #8 of admin-header.php, not line #569 of post.php. In this scenario, line #569 of post.php is the victim. It is being affected by the excess whitespace at line #8 of admin-header.php.

+0

现货上。在我的例子中,它是在我的'''wp-config.php'''文件中'''<?php''之前的空白行。 – yuvilio 2015-03-18 19:55:37

+0

对我来说,错误表示它在我的自定义主题的index.php中。导致此问题的换行符位于根标记index.php文件的php标记之前。 – Kyle 2018-02-12 22:41:10

19

wp-config.php添加该代码的第一行:

ob_start(); 
error_reporting(0); 
+0

谢谢,我会试试这个。对于延迟回复感到抱歉。 – user1192684 2012-03-28 13:36:29

+0

It Works!谢谢。 – 2013-02-18 07:17:54

+0

它的工作原理,谢谢。 – 2013-12-27 04:36:24

0

去除多余的blankspace /home/ya3mblog/public_html/wp-login.php在59行

相关问题