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

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

问题描述

我已经通过各种方式尝试在我们的Web服务器上安装 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天全站免登陆