1、由于phantomjs的压缩包是bz2格式,要先运行命令yum install bzip2安装bzip2
2、执行命令 tar -jxvf phantomjs-2.1.1-linux-x86_64.tar.bz2解压缩安装包
3、运行命令把解压缩的目录移动到/usr/local/目录下
4、运行命令安装fontconfig依赖包
5、输入命令ln -s /usr/local/phantomjs/bin/phntomhs /usr/bin创建phantomjs的软连接
6、输入命令phantomjs --version有版本号显示说明phantomjs安装成功了。到此在centos7.5上安装phantomjs的方法就介绍完了。