直接官网下载
我的环境是64位:
解压下文件root@ubuntu:~# wget https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2root@ubuntu:~# tar xvf phantomjs-2.1.1-linux-x86_64.tar.bz2root@ubuntu:~# mv phantomjs-2.1.1-linux-x86_64 phantomjsroot@ubuntu:~# mv phantomjs /usr/local/src/root@ubuntu:~# sudo ln -sf /usr/local/src/phantomjs/bin/phantomjs /usr/local/bin/phantomjsroot@ubuntu:~# phantomjs phantomjs: error while loading shared libraries: libfontconfig.so.1: cannot open shared object file: No such file or directory这个错误解决如下:root@ubuntu:~# sudo apt-get install build-essential g++ flex bison gperf ruby perl \ libsqlite3-dev libfontconfig1-dev libicu-dev libfreetype6 libssl-dev \ libpng-dev libjpeg-dev python libx11-dev libxext-devroot@ubuntu:~# phantomjs --version2.1.1完全解决了~!