0

I'm using wkhtmltopdf in my Symfony project and everything is working on my computer. But when I put my project on a CentOS server I'm no longer able to create pdf files.

I'm using this line, but on a linux server .exe files can't be executed:

$snappy = new Pdf($this->get('kernel')->getRootDir() . '/../web/wkhtmltopdf/bin/wkhtmltopdf.exe');

I tried to download the .rpm file for CentOS, but I still have the same errors.

LordArt
  • 3
  • 1
  • 1
  • 7

1 Answers1

0

I solved it by installing wkhtmltopdf like it's explained in this link: http://www.kitpages.fr/fr/cms/182/installer-wkhtmltopdf-sous-centos-et-debian

And after that I can give the path of wkhtmltopdf in CentOS which is: /opt/wkhtmltopdf/bin/wkhtmltopdf

The line is now like this:

$snappy = new Pdf('/opt/wkhtmltopdf/bin/wkhtmltopdf');
LordArt
  • 3
  • 1
  • 1
  • 7
  • Its better to avoid putting links because it maybe removed in the future , so put the details of the link and provide the reference at the end – wahdan Oct 06 '17 at 14:01