1.解压
wget https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-1.9.7-linux-x86_64.tar.bz2
tar -xjvf phantomjs-2.1.1-linux-x86_64.tar.bz2
tar (child): cannot run bzip2: No such file or directory
出现上述错误,请安装bzip2
执行指令:
yum -y install bzip2
2.将可执行文件放入系统路径
sudo ln -s /opt/deploy/icis-app/phantomjs-1.9.7-linux-x86_64/bin/phantomjs /usr/bin/phantomjs
分配给 deploy权限 chown -R deploy:deploy phantomjs-1.9.7-linux-x86_64
3.安装依赖
yum install fontconfig freetype2
4.查看安装
phantomjs -v
5.图片字体乱码 -安装字体
yum install bitmap-fonts bitmap-fonts-cjk
phantomjs /opt/deploy/icis-app/echarts-convert/echarts-convert.js -infile /opt/deploy/icis-app/data099b2ba5.json -outfile /opt/deploy/icis-app/test-radar.png