samedi 6 juin 2020

how to use barryvdh/laravel-snappy package in live server cpanel

guys iam working with a project. it was running in live. everything works fine.

now i need charts and graphs as report, so i installed barryvdh/laravel-snappy package in my local.

what i did is for Wkhtmltopdf Installation

i visited this link: https://wkhtmltopdf.org/downloads.html -- 64 bit because my system 64 bit and installed it normally. it is installed in my c/program files.

next i gave composer require barryvdh/laravel-snappy

next i added it in config/app.php

Barryvdh\Snappy\ServiceProvider::class,

'PDF' => Barryvdh\Snappy\Facades\SnappyPdf::class,
'SnappyImage' => Barryvdh\Snappy\Facades\SnappyImage::class,

next i gave this php artisan vendor:publish --provider="Barryvdh\Snappy\ServiceProvider"

Next what i did is in config/snappy.php i changed like below

  'pdf' => [
        'enabled' => true,
        'binary'  => '"C:\Program Files\wkhtmltopdf\bin\wkhtmltopdf.exe"',
        'timeout' => false,
        'options' => [],
        'env'     => [],
    ],

as it was installed in my local c/ program files

now i used the package and it worked fine in local.

now how i can take this package to cpanel server?

what i did is

copied the vendor folder, config folder, bootstrap folder, composer file, these to server.

is this enough?? how can i change the binary path in config/snappy.php in server?? what lines i should give there??

or else nothing to give, everything is fine??

in live it shows error like this

The exit status code '127' says something went wrong: stderr: "sh: C:\Program Files\wkhtmltopdf\bin\wkhtmltopdf.exe: command not found " stdout: "" command: "C:\Program Files\wkhtmltopdf\bin\wkhtmltopdf.exe" --lowquality '/tmp/knp_snappy5eda86d6b1db60.16736040.html' '/tmp/knp_snappy5eda86d6b1ec54.99483053.pdf'.

how to use this package in live cpanel server???

my laravel version is Laravel Framework 6.18.0



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/3cDDEhb
via IFTTT

Aucun commentaire:

Enregistrer un commentaire