直接官网下载http://phantomjs.org/download.html
我的环境是64位:https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2
解压下文件 [email protected]:~# wget https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2 [email protected]:~# tar xvf phantomjs-2.1.1-linux-x86_64.tar.bz2 [email protected]:~# mv phantomjs-2.1.1-linux-x86_64 phantomjs [email protected]:~# mv phantomjs /usr/local/src/ [email protected]:~# sudo ln -sf /usr/local/src/phantomjs/bin/phantomjs /usr/local/bin/phantomjs [email protected]:~# phantomjs phantomjs: error while loading shared libraries: libfontconfig.so.1: cannot open shared object file: No such file or directory 这个错误解决如下: [email protected]:~# 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-dev [email protected]:~# phantomjs --version 2.1.1 完全解决了~!
时间: 2024-12-24 05:29:40