Permiso de usuario de wkhtmltopdf

Parece que no puedo conseguir wkhtmltopdf to work on a user account.

As root user:

wkhtmltopdf -V
wkhtmltopdf http://google.com google.pdf

Both of the above work. But as a normal user I get an error:

wkhtmltopdf -V
wkhtmltopdf: error while loading shared libraries: libQtWebKit.so.4: cannot open shared     object file: No such file or directory

Obviamente, wkhtmltopdf is working and installed correctly, as it works for the root user, but not for all of the users.

I have tried setting permissions:

[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*

I have also tried adding to visudo:

motorconne localhost=/bin/wkhtmltopdf
motorconne localhost=/root/wkhtmltopdf-qt/lib/libQtWebKit.so.4

pero aun así no tuve suerte. ¿Algunas ideas?

preguntado el 31 de julio de 12 a las 13:07

try installing it as the user who intends to use it -

Just guessing, but are the paths correct? Maby root has a folder in it's path that the user doesn't and that's where the shared library sits? -

Can not install as user, error qmake.vars -

1 Respuestas

Estaba teniendo exactamente el mismo problema.

You probably followed install steps on the wkhtmltopdf wiki.

Resulta que libQtWebKit.so.4 Se encuentra en /root/wkqt/lib/ directory. This means that your user must be authorized to enter into this directory.

However, it is very likely that when you type cd /root, you will be denied access to the root carpeta.

The quick and dirty solution is to grant access to your root folder to anyone (yes, I said "quick and dirty"). For instance:

sudo chmod a+rx /root

Obviously, this is far from perfect. In a perfect world, you would not install the wkqt lib in the root directory. Instead /opt/wkqt would be more appropriate. You can probably do this by changing the configure command line when you build wkhtmltopdf-qt. Por ejemplo:

./configure -nomake tools,examples,demos,docs,translations -opensource -prefix "/opt/wkqt"

¡Espero que esto ayude!

Respondido el 29 de enero de 14 a las 11:01

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.