在CentOS中安装PhantomJS

问题描述 投票:3回答:3

我正在尝试在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。

centos phantomjs install
3个回答
0
投票

哇,这个版本很古老,你是否因为特定原因需要它?

无论如何,你的错误a basic Google search suggests installing额外的包:

libfontconfig

0
投票

没有包libfontconfig可用于centos。您可以尝试手动安装它:

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

0
投票

以下在Amazon Linux 2018.03上为我工作。 (虽然不完全相同,但亚马逊Linux与RedHat / Centos类似)

yum install fontconfig freetype freetype-devel fontconfig-devel libstdc++
© www.soinside.com 2019 - 2024. All rights reserved.