CentOs 安装phantomjs

1. 下注phantomjs . 要选对应的版本 Linux 

2. 设置环境变量 

1)vim /etc/profile 
2)在文件的最后一行,添加安装路径path语句:(注意路径是phantomjs的安装路径) 
export PATH=${PATH}:/usr/local/src/phantomjs/bin/ 
3)保存修改后的文件 
:wq 
4)使用命令使环境变量生效 
source /etc/profile

3. 测试 : phantomjs -v

出错提示

error while loading shared libraries: libfontconfig.so.1: cannot open shared object file: No such file or directory

安装补丁

sudo yum install fontconfig freetype libfreetype.so.6 libfontconfig.so.1

 

提示无权限,

就给它目录加权限

chmod -R 777 phantomjs

你可能感兴趣的:(100.上线运维)