Laravel-snappy: The exit status code '1' says something went wrong: stderr: "The system cannot find the path specified. "

Created on 5 Apr 2015  路  29Comments  路  Source: barryvdh/laravel-snappy

I m using this code in controller but i m facing this error

public function getPDF()
{
    $pdf = PDF::loadView('ab');
    return $pdf->download('invoice.pdf');
}

error

The exit status code '1' says something went wrong: stderr: "The system cannot find the path specified. " stdout: "" command: /usr/local/bin/wkhtmltopdf --lowquality "C:UsersAdminAppDataLocalTempknp_snappy552137b1a973a8.95135225.html" "C:UsersAdminAppDataLocalTempknp_snappy552137b1aa4969.49985920.pdf".

capture

stale

Most helpful comment

Download and install wkhtmltopdf

Windows (MSVC 2013) 32-bit / 64-bit for Windows Vista or later; bundles VC++ Runtime 2013

from this link
http://wkhtmltopdf.org/downloads.html

now copy wkhtmltopdf folder from program files and paste in c:/ drive now copy all the files from inner wkhtmltopdf folder and paste in c:/wkhtmltopdf folder

like this

wkhtmltopdf

now use this path in laravel snappy config file

'binary' => 'C:/wkhtmltopdf/wkhtmltopdf.exe',

config

All 29 comments

did you install wkhtml2pdf in that dir? If not, install It there or change the path in the config.

Please check this

capture1

Yeah so publish the config and change the location as described.

Thanks but now i am facing this error

capture2

I am using XAMP on windows 8.1

My issue solved with command

'binary' => 'C:/wkhtmltopdf/wkhtmltopdf.exe',

When i am using this commands i m facing error

'binary' => base_path('vendor/h4cc/wkhtmltopdf-i386/bin/wkhtmltopdf-i386')

I think this command is for linux only?

capture3

i have changed on my config but still error
screenshot_120

which operating system you are using

Windows 8.1 and Xampp 3.2.1

Download and install wkhtmltopdf

Windows (MSVC 2013) 32-bit / 64-bit for Windows Vista or later; bundles VC++ Runtime 2013

from this link
http://wkhtmltopdf.org/downloads.html

now copy wkhtmltopdf folder from program files and paste in c:/ drive now copy all the files from inner wkhtmltopdf folder and paste in c:/wkhtmltopdf folder

like this

wkhtmltopdf

now use this path in laravel snappy config file

'binary' => 'C:/wkhtmltopdf/wkhtmltopdf.exe',

config

Owh nice, works xD i forget to place to C:

app cannot read whitespace C:Program Files. thanks

I'm having the exact same issue, if I follow umairali guide, it works.. However I want to install it using composer, not by installation exe file.. Install using composer doesn't generate any .exe file, and the file produce this error. Any suggestion is appreciated..

@umairali Really Thank you for you answer it works prefectly now :)

You are very welcome. :)

i have the same problem as above. i am using laravel 5 and windows 8.1. i couldnt find config.php file in laravel 5. what do i have to do?

check snappy.php file in config folder

You can publish the config-file with

php artisan vendor:publish

can we use binary config from the vendor? I don't want to install to my computer

hey umairali,

I have performed steps exactly said by you but I still get the same error

I have installed wkhtmltox-0.12.3-dev-79ff51e_msvc2013-win64.exe

in C: drive and also set path in
capture

but still same error

capture1

please help

Find snappy.php file in config folder and change pdf binary path

'binary' => 'C:/wkhtmltopdf/wkhtmltopdf.exe',

Yah , my mistake....
After changing snappy.php in vendor folder using publish command changes automatically done in config/snappy.php

umairali, could you do a little tutorial, or steps on how to install the snappy. I found the instructions in the main website confusing. Thank you so much, this would be a great help!

I have the same error also. i am use this 'binary' => 'C:/wkhtmltopdf/wkhtmltopdf.exe', in my snappy.php by using this my whole website is not working. what should i do please help me
kk

Can you share screenshot of your wkhtmltopdf folder in c drive

Change the content of snappy.php file as below(double quotes in single quotes)

'binary' => '"C:/wkhtmltopdf/wkhtmltopdf.exe"',

Everything looks good for windows local server. But would you please tell us about real server where may do not available wkhtmltopdf. I like to use composer to install h4cc/wkhtmltoimage-i386 inside my vendor (project folder). It does not work in local server as well as real server. Its 32-bit operating system.

Having trouble with these commands, if I don't do them I get this same error but Laravel cmd is not letting me, says 'cp' is not recognized as an internal or external command

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

How to do this on Windows or how can I fix this?

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.

The exit status code '-1073741819' says something went wrong: stderr: "Loading pages (1/6)
[> ] 0%
[======> ] 10%
[=======> ] 13%
Error: Failed to load http://www.google.com/jsapi, with network status code 3 and http status code 0 - Host www.google.com not found
" stdout: "" command: C:/wkhtmltox/bin/wkhtmltopdf.exe --lowquality --enable-javascript --javascript-delay "5000" --enable-smart-shrinking --no-stop-slow-scripts

Was this page helpful?
0 / 5 - 0 ratings

Related issues

krtorio picture krtorio  路  5Comments

vitorarjol picture vitorarjol  路  4Comments

tbaraiya picture tbaraiya  路  3Comments

closca picture closca  路  7Comments

jerearaujo03 picture jerearaujo03  路  5Comments