简体   繁体   中英

Laravel Cashier producing corrupt pdf invoice on Fortrabiit

I'm using Laravel Cashier and can produce and download invoices fine in my local environment. The invoices are around 138KB. However, when I try to download the invoice in my Fortrabbit production environment the pdf produced is only 2KB and I cannot open it.

The error I get in Chrome is "Failed to load PDF document" and when I try to open it with OSX Preview the error is:

"The file “Subscription_8_2015 (1).pdf” could not be opened. It may be damaged or use a file format that Preview doesn't recognize"

Now, obviously this has something to do with server settings or missing package. Rather than me trawling for hours through these settings does anyone know off the top of their head what could be culprit?

Thanks in advance.

Maybe it will help if you show us some code. How does your controller look like? How is the output form / pdf file generated?

Start from scratch by simply creating an invoice with a plain "hello" in it and try to create it properly on fortrabbit and see if that works.

Change the file permission of the phantomjs file you need to 744 which will be located in either

(app_name)\laravel\cashier\src\Laravel\Cashier\bin\linix-i686

or

(app_name)\laravel\cashier\src\Laravel\Cashier\bin\linix-i686_64

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