我似乎无法wkhtmltopdf
在用户帐户上工作。
作为根用户:
wkhtmltopdf -V
wkhtmltopdf http://google.com google.pdf
上述两项工作。但作为普通用户,我收到一个错误:
wkhtmltopdf -V
wkhtmltopdf: error while loading shared libraries: libQtWebKit.so.4: cannot open shared object file: No such file or directory
显然,wkhtmltopdf
它工作和安装正确,因为它适用于 root 用户,但不适用于所有用户。
我试过设置权限:
[root@server ~]# chmod 755 /root/wkqt/
[root@server ~]# chmod 755 /root/wkqt/lib/
[root@server ~]# chmod 755 /root/wkhtmltopdf-qt/
[root@server ~]# chmod 755 /root/wkhtmltopdf-qt/lib/
[root@server ~]# chmod 644 /root/wkqt/lib/*so*
[root@server ~]# chmod 644 /root/wkhtmltopdf-qt/lib/*so*
我也尝试添加到visudo
:
motorconne localhost=/bin/wkhtmltopdf
motorconne localhost=/root/wkhtmltopdf-qt/lib/libQtWebKit.so.4
但仍然没有运气。有任何想法吗?