linux安裝phantomjs,-bash: /usr/local/bin/phantomjs: is a directory解決方案

首先安裝依賴——fontconfig和freetype
yum install fontconfig freetype2
在官網上下載對應版本的包
http://phantomjs.org/download.html
rz 上傳到服務器
tar -xvf 解壓 不要+z
設置軟鏈接
ln -sf /home/phantomjs-2.1.1-linux-i686/bin/phantomjs /usr/local/bin/phantomjs
配置環境
1)vim /etc/profile
2)在文件的最後一行,添加安裝路徑path語句:(注意路徑是phantomjs的安裝路徑)
export PATH=${PATH}:/usr/local/src/phantomjs/bin/
3)保存修改後的文件
:wq
4)使用命令使環境變量生效
source /etc/profile
最後一步,查看版本
phantomjs -v
若是出來版本號,即成功html

 


————————————————
原文連接:https://blog.csdn.net/qq_35309220/article/details/90411819linux

相關文章
相關標籤/搜索