简体   繁体   中英

Uncaught exception 'Exception' with message 'FPDF error PHP

I was developing this website which at some point, exports a PDF with some appointment details. It worked properly, but a few days ago it trowed me this error, and so far I couldn't figure out why. Thanks in advance!

Complete error:

Fatal error: Uncaught exception 'Exception' with message 'FPDF error: Some data has already been output, can't send PDF file (output started at /home/r46122expe/public_html/Domenii/wise-company.com/testprefectura/inf_permise/Rezervari/pdf.php:2)' in /home/r46122expe/public_html/Domenii/wise-company.com/testprefectura/inf_permise/Rezervari/fpdf.php:271 Stack trace: #0 /home/r46122expe/public_html/Domenii/wise-company.com/testprefectura/inf_permise/Rezervari/fpdf.php(1052): FPDF->Error('Some data has a...') #1 /home/r46122expe/public_html/Domenii/wise-company.com/testprefectura/inf_permise/Rezervari/fpdf.php(1012): FPDF->_checkoutput() #2 /home/r46122expe/public_html/Domenii/wise-company.com/testprefectura/inf_permise/Rezervari/pdf.php(123): FPDF->Output('D', 'programare.pdf') #3 {main} thrown in /home/r46122expe/public_html/Domenii/wise-company.com/testprefectura/inf_permise/Rezervari/fpdf.php on line 271

fpdf.php

http://pastebin.com/DfaSFCY2

output started at /home/r46122expe/public_html/Domenii/wise-company.com/testprefectura/inf_permise/Rezervari/ pdf.php:2

So you need to check this script and not FPDF. You may have white spaces at the beginning of your file or a BOM .

If you code in UTF-8 make sure that you re-save your file without BOM and make sure that your open php-tag is located at the first byte without any leading white spaces.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM