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

StefanVoinea's avatar

Laravel Vapor SnappyPDF Permission denied

I have this issue with SnappyPDF deployed with Laravel Vapor. When I try to generate pdf from view with SnappyPDF I receive this error:

{"message":"The exit status code '126' says something went wrong:\nstderr: "sh: /tmp/vendor/h4cc/wkhtmltopdf-amd64/bin/wkhtmltopdf-amd64: Permission denied\n"\nstdout: ""\ncommand: /tmp/vendor/h4cc/wkhtmltopdf-amd64/bin/wkhtmltopdf-amd64 --lowquality --orientation 'portrait' --page-size 'a4' '/tmp/knp_snappy5e2fd7264f9a41.66597394.html'

in snappy.php config file I have: 'binary' => '/tmp/vendor/h4cc/wkhtmltopdf-amd64/bin/wkhtmltopdf-amd64',

in composer.json "barryvdh/laravel-snappy": "^0.4.6", "h4cc/wkhtmltoimage-amd64": "0.12.x", "h4cc/wkhtmltopdf-amd64": "0.12.x",

In vapor.yml separate-vendor: true

Does anyone have an idea how can I solve this problem?

Thanks!

0 likes
2 replies
georgeboot's avatar

For what it’s worth, we use https://www.api2pdf.com/ to generate our pdf’s.

They render using Chrome Headless (and support other means) and they are basically charging cost price (which is almost nothing).

mmenacer's avatar

Hi,

Is there any solution to use Laravel Snappy with Laravel Vapor ?

Thanks,

Please or to participate in this conversation.