- 下载
下载地址:https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2wget https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2
- 解压安装包
[root@cdh01 soft]# yum -y install bzip2 [root@cdh01 soft]# bzip2 -d phantomjs-2.1.1-linux-x86_64.tar.bz2 [root@cdh01 soft]# tar xvf phantomjs-2.1.1-linux-x86_64.tar -C /root/soft
- 安装依赖
[root@cdh01 soft]# yum -y install fontconfig
- 配置环境变量
[root@cdh01 soft]# cat /etc/profile.d/phantomjs.sh export PHANTOMJS_HOME=/root/soft/phantomjs export PATH=$PHANTOMJS_HOME/bin:$PATH [root@cdh01 soft]# source /etc/profile
- 测试
[root@cdh01 soft]# cat test.js console.log('Hello world!'); phantom.exit(); [root@cdh01 soft]# phantomjs test.js Hello world!
Linux下安装使用PhantomJS
最新推荐文章于 2023-09-11 18:02:46 发布