LoginSignup
0
0

More than 5 years have passed since last update.

FPDFでheaders already sent byとwarningが出てoutput()できない時の解決策

Last updated at Posted at 2018-11-07

スクリーンショット 2018-11-07 11.16.54.png

こんなエラーが出た時です。

早速結論

下記を変更します

fpdf.php
function FPDF($orientation='P', $unit='mm', $format='A4')
{
fpdf.php
function __construct($orientation='P', $unit='mm', $format='A4')
{

理由

Depressedがキーワードです。
FPDFのコンストラクタは、「クラス名と同名のメソッドは、コンストラクタとして扱う」という古いルールで書かれています。
それが今回引っかかったようです。新しい書き方に直してあげたところ正常に動作しました。

0
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
0
0