tandrus-mc's avatar

FPDI instantiation results in 502 bad gateway

I've been beating my head against a wall with this for a while now and I was wondering if anyone had an idea why I'm having this issue, because I'm about ready to pull my hair out. I've pulled in fpdi/fpdf through composer into my lumen application, everything is autoloaded and I get no errors in php storm. However when I create a new fpdi object to start manipulating pdfs I get a 502, there is nothing in my logs, nothing at all to point me to some sort of solution. Any input would be very much appreciated.

0 likes
14 replies
tandrus-mc's avatar

Thaknks for the reply. I am using php 7.1, I'm going to try reverting to 7.0 and see if that helps. I'll let you know what happens. Oddly enough if I change something in fpdf class, save it and rerun it it works once.

mikebronner's avatar

What did you change? I tried dd() in the FPDF constructor (the base class) and it still errors, which makes me think it has to do with all the class_exists checking, etc., or some other ancillary non-PS4-adhering programming practices?

1 like
tandrus-mc's avatar

Yea that was my initial thought, I actually modified it into my own package and got rid off all that as well as modified the file and class names to meet psr-4 and it all autoloads fine now, the main issue though is php v 7.1 switch to 7.0 and you should be fine

tandrus-mc's avatar

I've been punching myself in the face for two days trying to figure this out.

tandrus-mc's avatar

I can see about uploading my modified fpdf/fpdi package to packagist if you'd like to check it out or use it. It does away with the bridging functionality so it won't work with tcpdf. It's all standardized and set up for psr-4 though.

tandrus-mc's avatar

Yea, fpdi is not compatible with php7.1 you must revert to php7.0 in order for it to work

mikebronner's avatar

Hmm, ok ... thanks ... have you found any issues opened against FPDI to indicate they are working on this? :)

tandrus-mc's avatar

none at all, php7.1 was just released like this month or something though

mikebronner's avatar

Oh, yea ... I thought maybe you had a concrete indicator what was wrong. Yea, I rolled back to 7.0 and its working again. Was hoping for something specific we might be able to act on. :) I'll keep you posted if I find anything out.

tandrus-mc's avatar

thanks man, yea I don't know the specific cause of the issue. let me know if you hear anything though.

Please or to participate in this conversation.