简体   繁体   English

我正在尝试在我的 VPS 上安装 wkhtmltopdf,但在执行时收到错误消息

[英]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:我做了以下事情:

  1. Start SSH terminal and login.启动 SSH 终端并登录。
  2. cd /var/www/vhosts/{domain}/subdomains/stage/httpdocs/lib/wkhtmltopdf cd /var/www/vhosts/{domain}/subdomains/stage/httpdocs/lib/wkhtmltopdf
  3. wget http://wkhtmltopdf.googlecode.com/files/wkhtmltopdf-0.10.0_rc2-static-i386.tar.bz2 wget http://wkhtmltopdf.googlecode.com/files/wkhtmltopdf-0.10.0_rc2-static-i386.tar.bz2
  4. tar -ixvf wkhtmltopdf-0.10.0_rc2-static-i386.tar.bz2 tar -ixvf wkhtmltopdf-0.10.0_rc2-static-i386.tar.bz2
  5. ./wkhtmltopdf-i386 http://www.example.com/ test.pdf ./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.好的,看看这个,我认为必须安装 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.

相关问题 我正在尝试用密码保护我的网站,当我弹出窗口登录并使用我的信用凭证时 - I'm trying to password protect my website and when i get the popup to login and i use my creds 我正在尝试在我的项目中安装 InfyOm Laravel Generator - I'm trying to install InfyOm Laravel Generator in my project 我正在尝试将批处理嵌入到 php 中,但它没有执行 - I'm trying to embedded batch into php, but it is not executing 我正在尝试将 maatwebsite/excel package 安装到我的 laravel 中,但出现此错误 - I'm trying to install maatwebsite/excel package to my laravel with but got this error 为什么在PHP中使用cURL在PC和VPS中获得不同的结果? - Why I get different results in my pc and vps with cURL in PHP? 我正在尝试使用表格中的数据填充模式文本框,但无法正常工作 - I'm trying to populate my modal textboxes with datas from my table but i can't get it to work 尝试在 php 中将新用户发布到我的 cUrl 测试环境时出现错误 - I'm getting an error when trying to POST a new user to my my cUrl testing enviroment in php 尝试在本地计算机上设置 wordpress 时遇到此错误,但因错误而失败 - I'm facing this error when trying to setup my wordpress on my local machine, but failed with error 我正在尝试在单元测试中使用KernetTestKase,但出现“未找到”错误 - I'm trying to use KernetTestKase in my unit tests, but I get a “not found” error 我正在尝试更新我的MySQL数据库 - I'm trying to update my mysql database
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM