如何在基于 linux 的(共享主机)Web 服务器上安装 wkhtmltopdf [英] How to install wkhtmltopdf on a linux based (shared hosting) web server

查看:24
本文介绍了如何在基于 linux 的(共享主机)Web 服务器上安装 wkhtmltopdf的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经尝试了各种方法在我们的网络服务器上安装 wkhtmltopdf,但不幸的是它没有被安装.我无法按照安装教程中的说明访问 user/bin 文件夹.

I have tried in all ways to get wkhtmltopdf installed on our web server but unfortunately it is not getting installed. I cannot access user/bin folder as stated in a tutorial on installation.

public_html文件夹中的服务器上有一个子文件夹_vti_bin,我从wkhtmltopdf-复制了文件wkhtmltopdf-i386-0.9.1-static-i386,但我无法执行.

On the server in public_html folder there is a sub folder _vti_bin, I copied the file wkhtmltopdf-i386 from wkhtmltopdf-0.9.1-static-i386, but I am not able to execute it.

如何在(共享主机)网络服务器上安装 wkhtmltopdf 并使其正常工作?

How to install wkhtmltopdf on (shared hosting) web server and get it working?

推荐答案

我已成功在没有 root 访问权限的共享主机帐户上安装 wkhtmltopdf-amd64.

I've managed to successfully install wkhtmltopdf-amd64 on my shared hosting account without root access.

这是我所做的:

从这里下载相关的静态二进制 v0.10.0:http://code.google.com/p/wkhtmltopdf/downloads/list

Downloaded the relevant static binary v0.10.0 from here: http://code.google.com/p/wkhtmltopdf/downloads/list

以上已移至此处

通过我的共享主机上的 ssh 输入以下内容:

via ssh on my shared host typed the following:

$ wget {relavant url to binary from link above}
$ tar -xvf {filename of above wget'd file}

然后,您将在主机上拥有二进制文件,并且无论它是否在/usr/bin/文件夹中,都可以运行它.(或者至少我能够)

you'll then have the binary on your host and will be able to run it regardless of if its in the /usr/bin/ folder or not. (or at least i was able to)

测试:

$ ./wkhtmltopdf-amd64 http://www.example.com example.pdf

  • 请注意,如果您在可执行文件所在的文件夹中,您可能应该以 ./ 开头以确保安全.
    • Note remember that if you're in the folder in which the executable is, you should probably preface it with ./ just to be sure.
    • 无论如何都为我工作

      这篇关于如何在基于 linux 的(共享主机)Web 服务器上安装 wkhtmltopdf的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆