0

I'm trying to generate pdfs with Symfony2, KnpSnappyBundle, Wkhtmltopdf on a mutualized OVH server.

I've putted wkhtmltopdf binary in the bin folder of symfony.

In\app\config\parameters.yml :

wkhtmlto.binary: %kernel.root_dir%/../bin/wkhtmltopdf 

In \app\config\config.yml :s

knp_snappy:
    pdf:
       enabled:    true
       binary:     %wkhtmlto.binary% 
       options:    []

With chmod 604 on wkhtmltopdf, I've this message :

The exit status code '126' says something went wrong:
stderr: "sh: /home/procontakq/Configurateur/app/../bin/wkhtmltopdf: 
Permission denied
"
stdout: ""
command: /home/procontakq/Configurateur/app/../bin/wkhtmltopdf --lowquality 
'/tmp/knp_snappy59cbc7c736b541.46778125.html' 
'/tmp/knp_snappy59cbc7c736c0f4.36952821.pdf'.

If I put the wkhtmltopdf binary with 715 access right , I have the following error message :

With chmod 715 on wkhtmltopdf, I've this message :

stderr: "sh: /home/procontakq/Configurateur/app/../bin/wkhtmltopdf: No such 
file or directory
"
stdout: ""
command: /home/procontakq/Configurateur/app/../bin/wkhtmltopdf --lowquality 
'/tmp/knp_snappy59cbc893b03971.22099815.html' 
'/tmp/knp_snappy59cbc893b03c91.27932094.pdf'.
zizoujab
  • 7,603
  • 8
  • 41
  • 72
Gilles Lengy
  • 75
  • 1
  • 10
  • What happens if you chmod to 755 instead of 715 – Jason Roman Sep 27 '17 at 16:24
  • if you have ssh access then you can follow this link : https://stackoverflow.com/questions/2273534/how-to-install-wkhtmltopdf-on-a-linux-based-shared-hosting-web-server?rq=1 , without it it's hard – zizoujab Sep 27 '17 at 16:48
  • With chmod at 715, I got the same message as with 715. – Gilles Lengy Sep 28 '17 at 08:26
  • Can't download the file throught ssh. Still, yesterday, I putted the .tar.xz int he bin folder and extract it via ssh... I'm stuck. I've tried a lot of things yesterday but none works. I'm going to work on something else and come back to it later with a fresh mind. Still If you have an idea, that would be nice ! – Gilles Lengy Sep 28 '17 at 08:29
  • I ended up using html2pdf bundle... – Gilles Lengy Sep 29 '17 at 09:06
  • Finally, after fighting with css using htmltopdf, I realize that : I can't do what I've been decided as desin of the pdf... I had not problem with wkhtmltopdf on my wamp so we willing to use it... So if anyone can help, I'll be really gratefull ! – Gilles Lengy Sep 29 '17 at 17:13
  • libX11 is missing on the server. We now use MpdfPortBundle. – Gilles Lengy Oct 05 '17 at 07:24

0 Answers0