在CentOS中安装PhantomJS

在CentOS中安装PhantomJS,centos,phantomjs,installation,Centos,Phantomjs,Installation,我正在尝试在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/pha

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

哇,这个版本很古老,你需要它有什么特殊的原因吗

无论如何,如果出现错误,请添加一个附加程序包:

libfontconfig

centos没有可用的程序包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

以下内容在Amazon Linux 2018.03上对我有用。(虽然不完全相同,但Amazon Linux与RedHat/Centos类似)


任何在CentOS上安装phantomJS并支持ES6的人。 遵循以下步骤

在CentOS上安装Wine(Wine允许您在linux发行版上运行windows.exe应用程序)

下载此软件包

就这么简单。享受


我已经用CentOS 6和7对其进行了测试

我遵循了一些博客中的步骤。您有安装最新版本的步骤吗。谢谢尝试不提供适用于CentOs的libfontconfig软件包。如果是libfontconfig1或类似软件包,您可以在搜索CentOs版本的同时搜索错误。
yum install fontconfig freetype freetype-devel fontconfig-devel libstdc++
wine64 phantomjs.exe script.js