1
0

More than 1 year has passed since last update.

PHP エラー 'headers already sent' 参考サイト

Posted at

このエラーは HTTP ヘッダーを変更する関数(header 等)の呼び出しより前に、すでに何かがアウトプットされているために発生する。

アウトプットには以下のようなものがあります。

意図していないアウトプット

  • <?php の前や、?> の後にある、スペースや改行の出力
  • PHP ファイルの先頭にある UTF-8 の BOM の出力
  • PHP による ErrorWarning メッセージ出力

意図したアウトプット

  • printechoreadfilepassthru など出力を伴う関数での出力
  • <?php の前や、 <?php 〜 ?> の外にある、生の <html> コードなどの出力
1
0
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0