barryvdh / laravel-snappy

Laravel Snappy PDF
MIT License
2.63k stars 290 forks source link

Error: The exit status code '127' #423

Closed cnyambo closed 3 years ago

cnyambo commented 3 years ago

Hi team, I am using Laravel on Linux 16.04. Installed wkhtmltopdf 0.12.6(wkhtmltox_0.12.6-1.xenial_amd64) using the dpkg -i path command. Wkhtmltopdf was installed successfully. I was able to download google page by running "wkhtmltopdf https://google.com google.pdf" wkhtmltopdf is available in the path: /usr/local/bin/wkhtmltopdf. the binary directory available in snappy.php is: 'binary' => '/usr/local/bin/wkhtmltopdf'. I checked all the documentations about this issue and tried to apply them but the error persisted. I don't understand what I have done wrong. the full error message is:

The exit status code '127' says something went wrong: stderr: "sh: 1: /usr/local/bin/wkhtmltopdf: not found " stdout: "" command: /usr/local/bin/wkhtmltopdf --lowquality '/tmp/knp_snappy6054f619cffb91.87186759.html' '/tmp/knp_snappy6054f619d01767.82081958.pdf'.

could you please help on this.

shunhua commented 3 years ago

解决了吗?同样的问题

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Any issues with PDF rendering itself that are not directly related to this package, should be reported on https://github.com/KnpLabs/snappy instead. When having doubts, please try to reproduce the issue with just snappy. If you believe this is an actual issue with the latest version of laravel-snappy, please reply to this issue so we can investigate further. Thank you for your contribution! Apologies for any delayed response on our side.

cnyambo commented 3 years ago

I solved the issue by creating a folder "bin" under the project and then my snappy.php looked like this:

<?php

return [

    'pdf' => [
        'enabled' => true,
        'binary' => base_path('bin/wkhtmltopdf'),
        'timeout' => false,
        'options' => [],
        'env'     => [],
    ],

    'image' => [
        'enabled' => true,
        'binary' => base_path('bin/wkhtmltoimage'),
        'timeout' => false,
        'options' => [],
        'env'     => [],
    ],

];

Thank you

jackbaron commented 2 years ago

@cnyambo it not working