ubuntu下安装PhantomJS
1.下载:
- 32位:wget https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-i686.tar.bz2
- 64位:wget https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2
2.解压:
- 32 位:tar -xvf phantomjs-2.1.1-linux-i686.tar.bz2
- 64 位:tar -xvf phantomjs-2.1.1-linux-x86_64.tar.bz2
3.移动文件
- sudo mv phantomjs-2.1.1-linux-x86_64.tar.bz2 /usr/local/src/phantomjs
4.安装相关依赖:
- sudo apt-get install build-essential chrpath libssl-dev libxft-dev libfreetype6-dev libfreetype6 libfontconfig1-dev libfontconfig1 -y
5.设置环境变量:
- sudo ln -sf /usr/local/src/phantomjs/bin/phantomjs /usr/local/bin/phantomjs
6.验证安装
- 在控制台输入 phantomjs -v
原文地址:https://www.cnblogs.com/ivy-blogs/p/10717653.html
时间: 2024-10-13 15:59:48