我正在使用wkhtmltopdf 0.12.1.4 (with patched qt)
从Django应用程序运行django-wkhtmltopdf
。在我的PC上,它运行良好,但是当我加载到DigitalOcean VPS上时,它会产生以下错误。
命令'['/ usr / bin / wkhtmltopdf','-B','0','-L','0','-R','0', '-T','0','-allow','True','-enable-local-file-access', '--encoding','utf8','-javascript-delay','2000', '--page-height','465mm','-page-width', 返回了“ 297mm”,“-quiet”,“ / tmp / wkhtmltopdf0xetqkp3.html”,“-”] 非零退出状态1。
当我从命令行运行时:
/usr/bin/wkhtmltopdf -B 0 -L 0 -R 0 -T 0 --allow True --enable-local-file-access --encoding utf8 --javascript-delay 2000 --page-height 465mm --page-width 297mm --quiet /tmp/wkhtmltopdf5_sl271s.html -
我得到以下输出:
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
Error: Failed loading page http:///tmp/wkhtmltopdf5_sl271s.html (sometimes it will work just to ignore this error with --load-error-handling ignore)
Exit with code 1 due to network error: HostNotFoundError
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
似乎正在尝试从http://...
而不是tmp
文件夹中提取文件,因此我认为我的某些设置有误。
有人可以帮忙吗? 谢谢
答案 0 :(得分:-1)
apt-get update
apt-get install libssl1.0-dev