且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在基于Linux的(共享主机)Web服务器上安装wkhtmltopdf

更新时间:2023-11-07 18:25:58

我已经成功地在没有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.
    • 反正为我工作