linux ubuntu 下安装phantomjs

sudo apt install phantomjs 

phantomjs -v 报错

在/usr/bin/phantomjs文件适当位置加上下面两行代码

  1. export QT_QPA_PLATFORM=offscreen
  2. export QT_QPA_FONTDIR=/usr/share/fonts

要跟着前面的那条“export

  1. #!/bin/sh
  2. LD_LIBRARY_PATH=”/usr/lib/phantomjs:$LD_LIBRARY_PATH”
  3. export LD_LIBRARY_PATH
  4. export QT_QPA_PLATFORM=offscreen
  5. export QT_QPA_FONTDIR=/usr/share/fonts
  6. exec “/usr/lib/phantomjs/phantomjs” “$@”

猜你喜欢

转载自www.cnblogs.com/sweetsunnyflower/p/10242895.html
今日推荐