Reputation: 2979
I've installed the barryvdh/laravel-snappy wrapper for wkhtmltopdf on my local dev server. I was getting an error with code 126. After reading through the github issues, I followed the advice of people that have experienced similar problems in the past by installing the "mac specific" package of wkhtmltopdf to disk and referencing the binary file from within laravel-snappy wrapper config file.
So, i changed my barry/laravel-snappy to:
'binary' => '/usr/local/bin/wkhtmltopdf',
With that change the pdf generation works great on my local server. My question is: How do I make this work on the live server?
I installed the laravel-snappy dependency on my live server, the program does not work and I got this message upon completion of composer update:
knplabs/knp-snappy suggests installing h4cc/wkhtmltopdf-i386 (Provide wkhtmltopdf-i386 binary, use version `0.12.0` as dependency)
I'd really like to avoid having different packages in my environments if that is possible. Finally, does the config file on the live server need to point back to the laravel/snappy vendor file to work properly?
Upvotes: 3
Views: 3844
Reputation: 200
I am experiencing a similar issue with laravel-snappy wrapper around wkhtmltopdf on ubuntu.
On my local server I just had to create a symbolic link because wkhtmltopdf's binary are there in /usr/bin/wkhtmltopdf and it seems that snappy is looking at /usr/local/bin/wkhtmltopdf.
If you have the same issue on your live server and that you have the rights to do sudo commands, just create the symlink:
sudo ln -s /usr/bin/wkhtmltopdf /usr/local/bin/wkhtmltopdf
In my case, my production server is hosted on heroku, and I don't have those rights... But I hope this resolve your issue.
Upvotes: 1