2012-02-06 52 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行

相關問題