Coder Social home page Coder Social logo

502 Gateway Error about fpdi HOT 12 CLOSED

setasign avatar setasign commented on June 17, 2024 1
502 Gateway Error

from fpdi.

Comments (12)

tandrus-mc avatar tandrus-mc commented on June 17, 2024

fpdf/fpdi is incompatible with php7.1 you need to revert back to 7.0 and your issue should be resolved.

from fpdi.

JanSlabon avatar JanSlabon commented on June 17, 2024

@tandrus-mc Why should it be incompatible to PHP 7.1? Do you have any further information for this statement? I just passed our dev version to 7.1 and all went through. I cannot remember any special change which was related to an issue with 7.1?

A gateway error shouldn't be related to PHP at all, doesn't it? Did you checked your error logs? of all involved processes?

from fpdi.

mikebronner avatar mikebronner commented on June 17, 2024

Hi @JanSlabon, the reason I see this as being incompatible with PHP7.1 is that when I try to run it in my PHP7.1 environment I get 502 Gateway errors, and when I run the exact same code in a PHP7.0 environment it works.

Many developers seem to be reporting this problem, and it might be related to usage in Laravel Homestead (a Vagrant VM development environment), or it's specific server configuration, but I find that unlikely because it works in Homestead with PHP7.0.

PHP can trigger gateway errors that cause the PHP process to crash, which then cuts communication to NGINX, triggering a 502 Gateway error.

from fpdi.

JanSlabon avatar JanSlabon commented on June 17, 2024

@mikebronner and what do you have in your error logs?
Do you have a link for us where the problem is reported by "many developers"? Maybe they have more information. Your description is sadly very vague and as we are unable to reproduce this in a "normal" environment.

BTW: What version are you using? The official version is not namespaced?

from fpdi.

JanSlabon avatar JanSlabon commented on June 17, 2024

There seems to be a bug report for an issue on bugs.php.net which is related to FPDF (so also FPDI), which seems to be fixed in the next 7.1 release.

from fpdi.

mikebronner avatar mikebronner commented on June 17, 2024

@JanSlabon Thanks for following up. I have been trying different FPDF wrappers, as well as yours to see if it was a "packaging issue". Here's a link where I'm trying to figure out the issue with someone else in the same boat, and I'm compiling any info on the issue I can find:

https://laracasts.com/discuss/channels/lumen/fpdi-instantiation-results-in-502-bad-gateway

Thanks for the link to the bug report.

~Mike

from fpdi.

JanSlabon avatar JanSlabon commented on June 17, 2024

Did you checked if you can reproduce the issue if opcache.enabled is set to 0?

This statement from @tandrus-mc makes me think that it is opcache related (as also the bug report):

Oddly enough if I change something in fpdf class, save it and rerun it it works once.

Can you verify this?

from fpdi.

w3sami avatar w3sami commented on June 17, 2024

Hi,
having the same issue with 7.1. verifying that disabling opcache resolves the issue. no more crash at new FPDI() \0/
my script is not still working, but that's propably just my proto code in infancy :)

from fpdi.

w3sami avatar w3sami commented on June 17, 2024

and, yes! even the code works! I can overlay text on a pdf and save it. so all issues resolved when disabling opcache. not a real solution, but works for me atm! thanks jan for figuring this out!

from fpdi.

JanSlabon avatar JanSlabon commented on June 17, 2024

PHP 7.1.1 is out - it should fix this issue. Could you please confirm, so that we can close this issue?

Thanks!
Jan

from fpdi.

w3sami avatar w3sami commented on June 17, 2024

hi!

I can confirm that the issue is resolved already at PHP 7.1.0-5 (before update it was 7.1.0-3 and not working)
PHP 7.1.0-5 is the version that the sury ppa provides for ubuntu atm

from fpdi.

JanSlabon avatar JanSlabon commented on June 17, 2024

As we didn't got any further report regarding that issue and it seems to be fixed in (at least) PHP 7.1.1 I will close that one.

from fpdi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.