2012-07-31 4 views
2

wkhtmltopdf을 사용자 계정에서 작동시키지 못하는 것 같습니다. 루트 사용자로서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가 작동하고 있지만 모든 사용자에 대한 루트 사용자에 대한 작동하기 때문에, 제대로 설치.

내가 시도 설정 권한 :

[[email protected] ~]# chmod 755 /root/wkqt/ 
[[email protected] ~]# chmod 755 /root/wkqt/lib/ 
[[email protected] ~]# chmod 755 /root/wkhtmltopdf-qt/ 
[[email protected] ~]# chmod 755 /root/wkhtmltopdf-qt/lib/ 
[[email protected] ~]# chmod 644 /root/wkqt/lib/*so* 
[[email protected] ~]# chmod 644 /root/wkhtmltopdf-qt/lib/*so* 

나는 또한 추가 시도 visudo에 :

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

하지만 여전히 행운. 어떤 아이디어?

+1

루트로 설치하셨습니까? –

+0

예 루트로 설치 되었음 – garethhallnz

+0

사용하려는 사용자로 설치해보십시오 –

답변

2

나는 똑같은 문제를 겪고있었습니다.

아마 wkhtmltopdf 위키에서 설치 단계를 따라 갔을 것입니다.

libQtWebKit.so.4/root/wkqt/lib/ 디렉토리에 있습니다. 이것은 사용자가이 디렉토리를 입력 할 수있는 권한이 있어야 함을 의미합니다.

그러나 cd /root을 입력하면 root 폴더에 대한 액세스가 거부 될 가능성이 큽니다.

신속하고 더러운 솔루션은 루트 폴더에 대한 액세스를 모든 사람에게 부여하는 것입니다 (예, "빠르고 더러운"라고 말했습니다). 예를 들면 다음과 같습니다.

sudo chmod a+rx /root 

분명히 이것은 완벽하지 않습니다. 완벽한 세계에서는 root 디렉토리에 wkqt lib를 설치하지 않을 것입니다. 대신 /opt/wkqt이 더 적절할 것입니다. wkhtmltopdf-qt을 빌드 할 때 configure 명령 줄을 변경하여이 작업을 수행 할 수 있습니다. 예 :

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

희망이 있습니다.