Comments (12)
fpdf/fpdi is incompatible with php7.1 you need to revert back to 7.0 and your issue should be resolved.
from fpdi.
@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.
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.
@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.
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.
@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.
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.
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.
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.
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.
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.
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)
- Undefined array key "rect" Error in FpdiTrait.php HOT 4
- Fix Release-Action
- Pages are overwritten after merging PDFs with more than 50 pages HOT 6
- special characters not correctly shown HOT 17
- PDF/A : endobj is missing EOL-Marker HOT 3
- Class "FPDF" not found HOT 2
- Custom Font HOT 3
- Added Text missing except on first page when viewing with some PDF software (incl. Acrobat) HOT 1
- setasign\\FpdiPdfParser\\PdfParser\\PdfPars Class not founded HOT 3
- PDF/A-3 with TCPDF (parameter not transmit)
- How wrap long title HOT 3
- FPDI - Getting "CrossReferenceException::OBJECT_NOT_FOUND" while trying to ImportPage from existing PDF file
- Indirect references in link annotation dictionaries creates corrupted PDFs (when FPDI is used with FPDF)
- Unable to find PDF file header. HOT 2
- while I setSourceFile ,then importPage, the seal missed HOT 1
- Problem with Y Coordinate on different page size HOT 2
- Undefined property: setasign\Fpdi\Tcpdf\Fpdi::$PDFVersion HOT 8
- Set Meta Data HOT 3
- Getting error while adding custom font. HOT 1
- (Question) Replace an Image inside a PDF HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fpdi.