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
5
Answers
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
: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.
For fedora use this:
execute following commands.
This worked for me on Centos 6.