2017-07-17 204 views
2

我想在Centos上安装PhantomJS。这些是我遵循的步骤。在CentOS上安装PhantomJS

yum install freetype fontconfig 
cd ~ 
wget https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-1.9.7-linux-i686.tar.bz2 
bunzip2 phantomjs*.tar.bz2 
tar xvf phantomjs*.tar 
cp phantomjs*/bin/phantomjs /usr/bin/phantomjs 

我收到以下错误。

phantomjs: error while loading shared libraries: libfontconfig.so.1: cannot open shared object file: No such file or directory 

任何人都可以抛出一些光。我已经安装了fontconfig。

回答

0

哇,这个版本是古老的,你需要它的具体原因?

反正a basic Google search您的错误suggests installing额外的包:可为CentOS

libfontconfig 
+0

我按照一些博客的步骤。你有没有安装最新版本的步骤。谢谢 ! –

+0

尝试https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-i686.tar.bz2 – Vaviloff

+1

无包可用于centos的libfontconfig –

0

无包libfontconfig。 您可以尝试手动安装它:

wget http://www.freedesktop.org/software/fontconfig/release/fontconfig-2.11.0.tar.gz 
tar -zxvf fontconfig-2.11.0.tar.gz 
cd fontconfig-2.11.0 
./configure -prefix=/usr 
make 
# move the file into /usr/lib manually (don't trust 'make install' on a production box) 
sudo mv ./src/.libs/libfontconfig.so.1.2.0 /usr/lib/ 
# and setup the libfontconfig.so.1 symlink 
cd /usr/lib 
sudo ln -s libfontconfig.so.1.2.0 libfontconfig.so.1