[英]I'm trying to install wkhtmltopdf on my VPS but get an errormessage when executing
I'm trying to install wkhtmltopdf on my virtual private server.我正在尝试在我的虚拟专用服务器上安装 wkhtmltopdf。 This is a tool to convert HTML to PDF.
这是一个将 HTML 转换为 PDF 的工具。
I did the following:我做了以下事情:
This is where I get my error:这是我得到错误的地方:
./wkhtmltopdf-i386: error while loading shared libraries: libXrender.so.1: cannot open shared object file: No such file or directory
Ok looking at this I'm thinking the libXrender has to be installed.好的,看看这个,我认为必须安装 libXrender。 So I tried to find the way to do that, but I'm not really linux expert.
所以我试图找到这样做的方法,但我并不是真正的 linux 专家。 What I did find was this:
我确实发现是这样的:
Before you install you will need to have X11, gcc and openssl installed.
在安装之前,您需要安装 X11、gcc 和 openssl。 On Debian/Ubuntu this can be done as follows:
在 Debian/Ubuntu 上,可以按如下方式完成:
sudo aptitude install openssl build-essential xorg libssl-dev libxrender-dev
sudo aptitude install openssl build-essential xorg libssl-dev libxrender-dev
And then I get this:然后我得到这个:
sudo: aptitude: command not found
sudo:能力:找不到命令
I think the vps is running redhat enterprise I'm not sure about the edition.我认为 vps 正在运行 redhat enterprise 我不确定版本。 It also has Plesk 10.3 running.
它还运行 Plesk 10.3。 In my plesk panel it says the vps is running centOS but when I type help in SSH it says redhat
在我的 plesk 面板中它说 vps 正在运行 centOS 但是当我在 SSH 中输入帮助时它说 redhat
See if you have any file called libXrender in your /usr/lib directory.查看 /usr/lib 目录中是否有任何名为 libXrender 的文件。 If you do, try creating a symbolic link with libXrender.so.1
如果这样做,请尝试使用 libXrender.so.1 创建符号链接
ln -s libXrender-whatever libXrender.so.1 ln -s libXrender-whatever libXrender.so.1
Try installing again your program.尝试再次安装您的程序。
If you don't have any libXrender file in /usr/lib, find the package by searching in google (you need to know your OS version)如果您在 /usr/lib 中没有任何 libXrender 文件,请通过 google 搜索找到 package(您需要知道您的操作系统版本)
uname -srv (will likely tell you your kernel version and distribution name) uname -srv(可能会告诉您您的 kernel 版本和发行版名称)
Once you download the package, just run下载 package 后,只需运行
rpm -Uvh [rpm-file-downloaded-for-libXrender] rpm -Uvh [rpm-file-downloaded-for-libXrender]
Then try installing your program again.然后再次尝试安装您的程序。
If you use redhat, I believe you can simply do如果你用redhat,相信你可以简单的做到
yum install [any-package-name] and it will download the appropriate version for your distro, if it finds it by the name you provided. yum install [any-package-name] 如果它通过您提供的名称找到它,它将为您的发行版下载适当的版本。
The package would have been libxrender-dev
for Ubuntu/Debian systems; package 本来是用于 Ubuntu/Debian 系统的
libxrender-dev
; and apt-get
instead of aptitude
usually.和
apt-get
而不是aptitude
通常。
For RPM systems, the package is called xrender
and you install it with yum
:对于 RPM 系统,package 称为
xrender
,您可以使用yum
安装它:
sudo yum install xrender
For fedora use this:对于 Fedora 使用这个:
sudo yum install libXrender
sudo yum install libXext
execute following commands.执行以下命令。
yum install openssl openssl-devel
ln -s /usr/local/bin/wkhtmltopdf /usr/sbin/
This worked for me on Centos 6.这在 Centos 6 上对我有用。
yum install libXext libXrender fontconfig libfontconfig.so.1
yum install urw-fonts
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.