FPDF with PHP 7

I am having difficulty with FPDF on PHP 7. I have just upgraded a (test) website to PHP 7 and with FPDF I get this message:

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; FPDF has a deprecated constructor in /home/iwant2wo/public_html/iw2w.com/dev/builder/classes/fpdf.php on line 12

I can see that felgall (https://www.sitepoint.com/community/users/felgall/activity) has said in a previous thread (PDF libraries compatible with PHP 7? - #2 by John_Betong) that it is compatible, but cleary I have an issue.

Can anyone point me in the right direction?

looks like you have an old version of FPDF, the recent version 1.81 already has the appropriate constructor.

Thanks Chorn, you were exactly right. I have updated to 1.81 and it’s all working as expected. Much appreciated.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.