Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

wkhtmltopdf

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
like image 999
stefan Avatar asked Aug 12 '14 15:08

stefan


2 Answers

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
like image 115
Narendra Solanki Avatar answered Oct 21 '22 12:10

Narendra Solanki


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

$options = array( ...,"binary" => "/usr/local/bin/wkhtmltopdf")
$pdf = new Pdf($options);
like image 34
stefan Avatar answered Oct 21 '22 10:10

stefan