wkhtmltoimage: QsslSocket

5.3k views Asked by At

I wanted to generate a HTML to an image, but I god this error:

The exit status code '1' says something went wrong: stderr: "Loading page (1/2) [> ] 0% [======> ] 10% QSslSocket: cannot resolve CRYPTO_num_locks QSslSocket: cannot resolve CRYPTO_set_id_callback QSslSocket: cannot resolve CRYPTO_set_locking_callback QSslSocket: cannot resolve sk_free QSslSocket: cannot resolve sk_num QSslSocket: cannot resolve sk_pop_free QSslSocket: cannot resolve sk_value QSslSocket: cannot resolve SSL_library_init QSslSocket: cannot resolve SSL_load_error_strings QSslSocket: cannot resolve SSLv3_client_method QSslSocket: cannot resolve SSLv23_client_method QSslSocket: cannot resolve SSLv3_server_method QSslSocket: cannot resolve SSLv23_server_method QSslSocket: cannot resolve X509_STORE_CTX_get_chain QSslSocket: cannot resolve OPENSSL_add_all_algorithms_noconf QSslSocket: cannot resolve OPENSSL_add_all_algorithms_conf QSslSocket: cannot resolve SSLeay QSslSocket: cannot call unresolved function CRYPTO_num_locks QSslSocket: cannot call unresolved function CRYPTO_set_id_callback QSslSocket: cannot call unresolved function CRYPTO_set_locking_callback QSslSocket: cannot call unresolved function SSL_library_init QSslSocket: cannot call unresolved function SSLv23_client_method QSslSocket: cannot call unresolved function sk_num [=========> ] 15% [==================> ] 30% [========================> ] 40% QSslSocket: cannot call unresolved function SSLv23_client_method QSslSocket: cannot call unresolved function SSL_library_init [============================================================] 100% Rendering (2/2) [> ] 0% [===============> ] 25% [============================================================] 100% Done Exit with code 1 due to network error: UnknownNetworkError QSslSocket: cannot call unresolved function CRYPTO_num_locks QSslSocket: cannot call unresolved function CRYPTO_set_id_callback QSslSocket: cannot call unresolved function CRYPTO_set_locking_callback " stdout: "" command: /var/www/botond/vendor/h4cc/wkhtmltoimage-amd64/bin/wkhtmltoimage-amd64 --format 'jpg' '/tmp/knp_snappy5bb7d38dbfea18.2936 5936.html' 'img/temp/weather/Battonya_1538773901_raw.jpg'.

I saw somewhere that I have to install libssl1.0-dev, but when I tried to give the command: sudo apt-get install libssl1.0-dev I got the error that this repository is missing. I found a page where I downloaded the .deb, but when I tried to install it, I got en error, that I already have the new version. How to solve it?

2

There are 2 answers

0
iateadonut On BEST ANSWER

pizzamonster is right.

Go here: https://wkhtmltopdf.org/downloads.html

Download the 0.12.5 version for your operating system.

I'm using Mint 19 (ubuntu 18.04) so I'll keep going with that.

After you install the package, do:

which wkhtmltoimage

You'll probably get /usr/local/bin/wkhtmltoimage - so just copy this to a new place in your laravel project, in your case I'd make a new 'bin' directory, like this:

/var/www/botond/bin/

and then put wkhtmltoimage in that directory so you can commit it to your project.

Assuming you're using the snappy package by barryvdh (barryvdh/laravel-snappy), change your 'binary' attribute in your 'image' array (/config/snappy.php) to this:

'binary' => base_path('bin/wkhtmltoimage'),

or perhaps something like this:

'binary' => env('SNAPPY_IMG_BIN', base_path('bin/wkhtmltoimage')),

and you should be all set. You can, of course, also change binary to '/usr/local/bin/wkhtmltoimage' - or perhaps use this in your .env:

SNAPPY_PDF_BIN=/usr/local/bin/wkhtmltopdf

Good luck.

p.s. since you're doing this on Laravel, you might want to change the name of the question to 'wkhtmltoimage: QsslSocket Laravel barryvdh/laravel-snappy'

0
Mateusz Przybylek On

In my case (Debian buster 10.x) I need to update wkhtmltopdf binaries to newest one via composer. Unfortunately most common h4cc bins are abandoned. I prepare new updated one:

composer require getoxs/wkhtmltopdf-buster-amd64

https://packagist.org/packages/getoxs/wkhtmltopdf-buster-amd64