ubuntu手动安装PhantomJS
1.切换到主目录:cd ~
2.下载安装包:https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-Linux-x86_64.tar.bz2
3.更新系统:sudo apt-get update
4.安装依赖包:sudo apt-get install build-essential chrpath libssl-dev libxft-dev
5.安装必要的依赖包:
sudo apt-get install libfreetype6 libfreetype6-dev
sudo apt-get install libfontconfig1 libfontconfig1-dev
6.设置变量: export PHANTOM_JS="phantomjs-2.1.1-linux-x86_64"
7.解压之前下载的安装包:sudo tar xvjf $PHANTOM_JS.tar.bz2
8.将解压后的安装包移动到安装目录下:sudo mv $PHANTOM_JS /usr/local/share
9.创建一个系统link:sudo ln -sf /usr/local/share/$PHANTOM_JS/bin/phantomjs /usr/local/bin
10.查看版本:phantomjs --version