服务器使用phantomjs报错:phantomjs unexpectedly exited. Status code was: 127

原因是因为缺少phantomjs运行的依赖包
Ubuntu尝试:

sudo apt-get install libfontconfig



centos尝试: 

用wget安装phantomjs依赖的libfontconfig
sudo yum install fontconfig freetype libfreetype.so.6 libfontconfig.so.1 libstdc++.so.6  



运行过程中还可能报错没有可执行权限

进入到phantomjs/bin目录下,执行

chmod 777 phantomjs

猜你喜欢

转载自blog.csdn.net/liaonanfeng88/article/details/84892544