Warning: Cannot modify header information – headers already sent byエラーの発生原因と対処した方法

エラーメッセージ全文

Warning: Cannot modify header information – headers already sent by (output started at ファイルパス/wp-includes/functions.php:6691) in ファイルパス/wp-includes/pluggable.php on line 1435

Warning: Cannot modify header information – headers already sent byエラーが表示された状況

wp-config.phpでdefine(‘WP_DEBUG’, true);に変更してデバッグモードにしたところ表示されるようになりました。

エラー発生箇所が、wp-include内なのでファイルを直接編集するのは良くないです

Warning: Cannot modify header information – headers already sent byエラーを対処した方法

define(‘WP_DEBUG’, true);に変更したときに、エラーが発生するのがロリポップサーバーの時だと気づきました。

サーバー側の「PHP設定」で対処していきます。

「PHP設定」で対象ドメインのPHPがCGI版になっているか確認する。

CGI版でないと「PHP設定」が反映されません。

「PHP設定」でoutput_bufferingの値を「1」に変更する

これでエラーが表示されなくなります。

他のPHPエラーの記事

他のPHPエラー

PHPのエラーの種類について解説しています。具体例や解決方法については順次更新していきます。

>お問い合わせはこちら

お問い合わせはこちら