一、下载安装包linux
wget https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2
二、解压bash
tar -xvf phantomjs-2.1.1-linux-x86_64.tar.bz2
三、将文件移到/usr/local/目录下blog
mv /usr/local/src/phantomjs-1.9.7-linux-x86_64 /usr/local/phantomjs
四、软连接get
ln -s /usr/local/phantomjs/bin/phantomjs /usr/local/bin/
可能会碰到这个报错:it
phantomjs: error while loading shared libraries: libfontconfig.so.1: cannot open shared object file: No such file or directory
这个须要安装libfontconfig1库class
apt-get install libfontconfig1