debian error while loading shared libraries: libQt5Core.so.5: cannot open shared object file: No such file or directory

  1. root@localhost:~# phantomjs --version
  2. "/usr/lib/phantomjs/phantomjs: error while loading shared libraries: libQt5Core.so.5: cannot open shared object file: No such file or directory"
  3.  
  4. root@localhost:~# strip --remove-section=.note.ABI-tag /usr/lib64/libQt5Core.so.5
  5.  
  6. root@localhost:~# phantomjs --version
  7. QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'
  8. qt.qpa.screen: QXcbConnection: Could not connect to display :99
  9. Could not connect to any X display.
  10.  
  11. #xvfb (short for X virtual framebuffer) 虚拟显示服务,跑在内存里
  12. #方法1:使用xvfb-run直接运行
  13. root@localhost:~# xvfb-run phantomjs --version
  14. QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'
  15. QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'
  16. 2.1.1
  17.  
  18. #方法2:
  19. root@localhost:~# (Xvfb :99 &) ; export DISPLAY=:99
  20.  
  21. root@localhost:~# phantomjs --version
  22. QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'
  23. QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'
  24. 2.1.1
1 1