一、下載安裝包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