Could not create PDF: sh: wkhtmltopdf: command not found
Asked Answered
R

2

13

Just having some trouble with wkhtmltopdf. It works fine in command line but in PHP I keep getting this error:

Could not create PDF: sh: wkhtmltopdf: command not found.

It does work after a stop and restart of Apache, but it stops working after a couple of hours.

This is the current configuration:

phpwkhtmltopdf - latest version 
CentOS 5.10
wkhtmltopdf 0.12.1
Rooker answered 12/8, 2014 at 15:15 Comment(0)
R
20

Everything seems to work amazing if I declare the binary as well..

$options = array( ...,"binary" => "/usr/local/bin/wkhtmltopdf")
$pdf = new Pdf($options);
Rooker answered 8/9, 2014 at 16:16 Comment(0)
S
2

Try to install core library in system

Ubuntu 14.04 x64
Ubuntu 16.04 x64

sudo apt-get update
sudo apt-get install xvfb libfontconfig wkhtmltopdf
Scab answered 25/7, 2019 at 12:48 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.