Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

rappasoft's avatar

laravel-snappy on local mac?

I'm trying to install https://github.com/barryvdh/laravel-snappy on my local mac for html to pdf conversions. I have https://github.com/barryvdh/laravel-dompdf installed but I can't get the loading of the stylesheet working so i'm trying this solution.

Anyway, I have all the dependencies and paths hooked up, but when I try to run it I get:

.../vendor/h4cc/wkhtmltopdf-amd64/bin/wkhtmltopdf-amd64: cannot execute binary file

Anyone have this issue?

Edit:

For anyone wondering, you need these for mac: https://github.com/yukihr/wkhtmltopdf-0.12.0-build-osx-10.9.1

However I'm getting the same output as dompdf, so what are the big pros of snappy over dompdf?

0 likes
2 replies
nam_co's avatar

Hi, did you ever manage to fix snappy?

mikevrind's avatar

I have used laravel-snappy without any problems. Check the installation instructions:

Move the binaries to a path that is not in a synced folder, for example:

cp vendor/h4cc/wkhtmltoimage-amd64/bin/wkhtmltoimage-amd64 /usr/local/bin/ .

cp vendor/h4cc/wkhtmltopdf-amd64/bin/wkhtmltopdf-amd64 /usr/local/bin/ and make it executable:

chmod +x /usr/local/bin/wkhtmltoimage-amd64

chmod +x /usr/local/bin/wkhtmltopdf-amd64 .

This will prevent the error 126.

Please or to participate in this conversation.