# 1.安装依赖
sudo yum install gcc gcc-c++ make git openssl-devel freetype-devel fontconfig-devel
# 2.去github下载phantomjs安装包
git clone git://github.com/ariya/phantomjs.git
# 3.进入下载好的安装包目录
cd phantomjs
# 4.phantomjs安装
git checkout 1.9
./build.sh

加入环境变量

# 1.编辑环境配置文件
vim /etc/profile

# 2.加入phantomjs执行路径
export PATH="$PATH:/yourpath"

# 3.继续添加,不要问为啥,加上不出问题
export PHANTOMJS_EXECUTABLE=/usr/local/bin/phantomjs

# 4.添加软连接,用于执行
ln -s /你的phantomjs安装路径 /usr/local/bin/

# 5.查看是否安装成功
phantomjs --version
1.9.8

 

相关文章:

  • 2021-12-02
  • 2021-08-22
  • 2021-07-29
  • 2021-10-09
  • 2021-11-21
  • 2021-11-13
  • 2021-08-18
  • 2021-11-16
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-05-25
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案