美文网首页
Linux/CentOS 安装PhantomJS

Linux/CentOS 安装PhantomJS

作者: 程序员的自我修养 | 来源:发表于2020-05-27 08:51 被阅读0次

1. 安装步骤

1.1 在服务器上新建想要下载和安装的目录:

如mkdir  PhantomJS

1.2 下载PhantomJS安装包

wgethttps://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2

执行结果如下图:

1.3 解压工具包

tar -xjvf phantomjs-2.1.1-linux-x86_64.tar.bz2

执行时报如下错误:

tar (child): cannot run bzip2: No such file or directory

出现上述错误,请安装bzip2

执行指令:

yum -y install bzip2

再次执行解压指令:

成功完成解压。

1.4 将可执行文件放入系统路径

sudo ln -s ~/bin/phantomjs-2.1.1-linux-x86_64/bin/phantomjs /usr/bin/phantomjs

1.5 安装依赖——fontconfig和freetype:

yum install fontconfig

yum install freetype

1.6 在终端下测试Phantomjs

注意系统目录为/usr/bin/

至此成功

相关文章

网友评论

      本文标题:Linux/CentOS 安装PhantomJS

      本文链接:https://www.haomeiwen.com/subject/kgcuohtx.html