,

FPDF error Unable to create output file

File doesn't exist

Solution: Correct the file path!

# Create file
$tmp_name = tempnam("/tmp", "FOO");

# Don't use extension ".pdf"
$pdf->Output($tmp_name);

This should fix it, if not:

  • Check if directory /tmp is correct and available
  • Try to create the file with tempnam() and use the command line to confirm the file is there