Linux环境下安装phantomjs
一、创建文件夹,用来存放软件
cd /opt/softWare
mkdir phantomJS
cd phantomJS
二、下载并解压
wget https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2
tar -xjvf phantomjs-2.1.1-linux-x86_64.tar.bz2
三、建立软连接,方便使用
ln -s /opt/softWare/phantomJS/phantomjs-2.1.1-linux-x86_64/bin/phantomjs /usr/bin/phantomjs
四、检查安装是否正常
which phantomjs
phantomjs -v
五、异常处理
报错:phantomjs: error while loading shared libraries: libfontconfig.so.1: cannot open shared object file: No such file or directory
原因:缺少包导致
解决方法:sudo apt-get install libfontconfig

浙公网安备 33010602011771号