wkhtmltoimage: QsslSocket

wkhtmltoimage: QsslSocket

我想为图像生成 HTML,但我天知道这个错误:

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'.

我在某个地方看到我必须安装 libssl1.0-dev,但是当我尝试输入命令时:sudo apt-get install libssl1.0-dev 我得到了这个存储库丢失的错误。我在下载 .deb 的地方找到了一个 page,但是当我尝试安装它时,出现错误,提示我已经有了新版本。 如何解决?

pizzamonster 是对的。

转到这里: https://wkhtmltopdf.org/downloads.html

下载适用于您的操作系统的 0.12.5 版本。

我正在使用 Mint 19 (ubuntu 18.04),所以我会继续使用它。

安装包后,执行:

wkhtmltoimage

你可能会得到 /usr/local/bin/wkhtmltoimage - 所以只需将其复制到你的 laravel 项目中的一个新位置,在你的情况下我会创建一个新的 'bin' 目录,比如这个:

/var/www/botond/bin/

然后将 wkhtmltoimage 放在该目录中,以便您可以将其提交到您的项目中。

假设您正在使用 barryvdh (barryvdh/laravel-snappy) 的 snappy 包,更改 'image' 数组中的 'binary' 属性 (/config/snappy.php) 对此:

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

或者可能是这样的:

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

你应该准备就绪。当然,您也可以将二进制更改为 '/usr/local/bin/wkhtmltoimage' - 或者在您的 .env 中使用它:

SNAPPY_PDF_BIN=/usr/local/bin/wkhtmltopdf

祝你好运。

p.s。由于您是在 Laravel 上执行此操作,因此您可能希望将问题的名称更改为 'wkhtmltoimage: QsslSocket Laravel barryvdh/laravel-snappy'

就我而言 (Debian buster 10.x) 我需要通过 composer 将 wkhtmltopdf 二进制文件更新为最新的二进制文件。不幸的是,大多数常见的 h4cc bin 都被废弃了。我准备了新更新的:

composer require getoxs/wkhtmltopdf-buster-amd64

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