-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
wkhtmltopdf support? #567
Comments
Hello @khoerodin in an older version of laradock I've used this changes:
TL;DRYou have to install more than only libXrender1 package. EDIT: |
stay not working for me .. |
I added the following to my php-fpm Dockerfile (I'm using -56 but would expect others to work also) RUN \
apt-get update && \
apt-get install -y fonts-droid fontconfig libfontconfig1 libfreetype6 libpng12-0 libssl1.0.0 libx11-6 libxext6 libxrender1 xfonts-75dpi xfonts-base wget xz-utils && \
cd /tmp && \
wget -nv https://downloads.wkhtmltopdf.org/0.12/0.12.4/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz -O wkhtmltox.tar.xz && \
tar -xaf wkhtmltox.tar.xz && \
rm -f wkhtmltox.tar.xz && \
mv wkhtmltox/bin/wkhtmlto* /usr/local/bin/ && \
apt-get -y install libtidy-dev && \
docker-php-ext-install tidy && \
apt-get clean && rm -rf /var/lib/apt/lists/* |
It is really important to install the Also, with the last version of Laradock, I had to remove the |
I couldn't get it to work with the static binaries from @h4cc from github. After a lot of problems and research I fixed it with adding this to php-fpm/dockerfile, which will build it from source, one time the debian package for the php-fpm container and one time the ubuntu package for the workspace container.
This to workspace/dockerfile
And the variables to docker-compose.yml
Hope it helps someone.. |
@ndberg |
@mrbase I updated the Code, i had troubles myself as the command: |
Actually ended up using the binary from https://github.com/h4cc/wkhtmltopdf-amd64/ The errors I got was rather confusing |
Hello, Today I have installed Laradock on a new computer, and I faced once again the same issues with wkhtmltopdf on Laradock. I tried the solution of @ndberg : the workspace and php-fpm build, but I have this error when I run wkhtmltopdf:
So I ended up using the binary from h4cc (thanks @mrbase).
As I said in my message last year, you must install the libssl1.0-dev package in the php-fpm container and the libssl1.0.0 package in the workspace container. Step-by-step instructionsI have tested it on a fresh installation of Laradock (last version) with a Laravel project using Laravel Snappy.
For example:
File to edit: /laradock/docker-compose.yml
File to edit: /laradock/php-fpm/Dockerfile
Rebuild the container:
File to edit: /laradock/workspace/Dockerfile
Rebuild the container: Hope it helps! |
@guicara Maybe we should extend the script sections
with commands to download and install the latest versions from https://wkhtmltopdf.org/downloads.html with all needed dependencies? Than the outdated and abandoned |
Anyone has an update on this request? It would be nice to have it already integrated inside laradock with the proper wkhtmltopdf version |
workspace\Dockerfile
php-fpm\Dockerfile
|
@johnathansantos Perfect. This help me a lot. And also this is working in php-worker ONLY (!!!) if php-worker is inside workspace (#2330). Don't know why but wkhtmltopdf not working in php-worker as separate container |
@glebgoloborodko You need to add it to the php-worker image as well. |
Sorry. Yes I fixed it already) thanks |
Bro, how do you installed these packages on php-worker since it use alpine linux? |
I guess you had the same issue than me =/. I can generate the pdf perfectly when it's called at controller. When i need to generate it on jobs/queues, it's throw an error 127 and it seems the package isn't installed. I installed using composer, so my path on snappy.php is the base_path('vendor/h4cc/wkhtmltopdf-amd64/bin/wkhtmltopdf-amd64'). |
@andrepaes as I said wkhtmltopdf is working ONLY if php-worker is inside workspace container (#2330). How I did this:
Now when you will enter workspace:
You must see your "test.conf" file from "php-worker\supervisor.d" in
|
Hi 👋 this issue has been automatically marked as |
Hi again 👋 we would like to inform you that this issue has been automatically |
update host https://downloads.wkhtmltopdf.org to https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download wkhtmltopdf/wkhtmltopdf@ba575ea php-fpm\Dockerfile
|
Hi..
Iam trying to install Laravel Snappy, i am also install wkhtmltopdf and libXrender1 on workspace container, and when generating PDF with wkhtmltopdf, showing an error:
Can anybody help me please?
The text was updated successfully, but these errors were encountered: