は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終了タグでないか、または終了タグ?>
の後ろに空白行または空白がないことを確認してください。
保存するときは、ファイルのエンコーディングがUTF-8 BOMではなく、プレーンUTF-8かBOMサフィックスのないものであることを確認してください(このPHPファイルは正常終了しません)。
そして:
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.
Spot on。私の場合、 '' 'wp-config.php'''ファイルの' '' <?php''の前に空白行を挿入していました。 – yuvilio
私にとっては、エラーは私のカスタムテーマのindex.phpにあると言いました。問題の原因となった改行は、rootのwordpress index.phpファイルのphpタグの前にあります。 – Kyle