我正在尝试在我的 VPS 上安装 wkhtmltopdf 但在执行时收到错误消息
我正在尝试在我的虚拟专用服务器上安装 wkhtmltopdf。这是一个将 HTML 转换为 PDF 的工具。
我执行了以下操作:
- 启动 SSH 终端并登录。
- cd /var/www/vhosts/{domain}/subdomains/stage/httpdocs/lib/wkhtmltopdf
- wget http://wkhtmltopdf.googlecode.com/files/wkhtmltopdf-0.10.0_rc2-static-i386.tar.bz2
- tar -ixvf wkhtmltopdf-0.10.0_rc2-static-i386.tar.bz2
- ./ wkhtmltopdf-i386 http://www.example.com/ test.pdf
这是我收到错误的地方:
./wkhtmltopdf-i386: error while loading shared libraries: libXrender.so.1: cannot open shared object file: No such file or directory
好的,看看这个,我认为必须安装 libXrender。所以我试图找到方法来做到这一点,但我并不是真正的Linux专家。我发现的是这样的:
安装之前,您需要安装 X11、gcc 和 openssl 安装。在 Debian/Ubuntu 上,可以按如下方式完成:
sudo aptitude install openssl build-essential xorg libssl-dev libxrender-dev
然后我得到:
sudo: aptitude: 未找到命令
我认为 vps 正在运行 redhat enterprise 我不确定版本。它还运行 Plesk 10.3。在我的 plesk 面板中,它显示 vps 正在运行 centOS,但是当我在 SSH 中输入帮助时,它显示 redhat
I'm trying to install wkhtmltopdf on my virtual private server. This is a tool to convert HTML to PDF.
I did the following:
- Start SSH terminal and login.
- cd /var/www/vhosts/{domain}/subdomains/stage/httpdocs/lib/wkhtmltopdf
- wget http://wkhtmltopdf.googlecode.com/files/wkhtmltopdf-0.10.0_rc2-static-i386.tar.bz2
- tar -ixvf wkhtmltopdf-0.10.0_rc2-static-i386.tar.bz2
- ./wkhtmltopdf-i386 http://www.example.com/ test.pdf
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. So I tried to find the way to do that, but I'm not really linux expert. What I did find was this:
Before you install you will need to have X11, gcc and openssl
installed. On Debian/Ubuntu this can be done as follows:sudo aptitude install openssl build-essential xorg libssl-dev libxrender-dev
And then I get this:
sudo: aptitude: command not found
I think the vps is running redhat enterprise I'm not sure about the edition. It also has Plesk 10.3 running. In my plesk panel it says the vps is running centOS but when I type help in SSH it says redhat
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
查看 /usr/lib 目录中是否有名为 libXrender 的文件。如果这样做,请尝试使用 libXrender.so.1 创建符号链接
ln -s libXrender-whatever libXrender.so.1
尝试再次安装您的程序。
如果您在 /usr/lib 中没有任何 libXrender 文件,请通过在 google 中搜索找到该软件包(您需要知道您的操作系统版本)
uname -srv (可能会告诉您您的内核版本和发行版名称)
一旦您下载了包,只需运行
rpm -Uvh [rpm-file-downloaded-for-libXrender]
然后尝试再次安装程序。
如果您使用 redhat,我相信您可以简单地执行
yum install [any-package-name] ,如果它通过您提供的名称找到它,它将下载适合您的发行版的版本。
See if you have any file called libXrender in your /usr/lib directory. If you do, try creating a symbolic link with 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)
uname -srv (will likely tell you your kernel version and distribution name)
Once you download the package, just run
rpm -Uvh [rpm-file-downloaded-for-libXrender]
Then try installing your program again.
If you use redhat, I believe you can simply do
yum install [any-package-name] and it will download the appropriate version for your distro, if it finds it by the name you provided.
对于 Ubuntu/Debian 系统,该软件包是
libxrender-dev
;通常用apt-get
代替aptitude
。对于 RPM 系统,该软件包称为
xrender
,您可以使用yum
安装它:The package would have been
libxrender-dev
for Ubuntu/Debian systems; andapt-get
instead ofaptitude
usually.For RPM systems, the package is called
xrender
and you install it withyum
:对于软呢帽,请使用以下命令:
For fedora use this:
执行以下命令。
execute following commands.
这在 Centos 6 上对我有用。
This worked for me on Centos 6.