无法创建 PDF: sh: wkhtmltopdf: command not found [英] Could not create PDF: sh: wkhtmltopdf: command not found

查看:28
本文介绍了无法创建 PDF: sh: wkhtmltopdf: command not found的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

只是在使用 wkhtmltopdf 时遇到了一些麻烦.它在命令行中运行良好,但在 PHP 中我不断收到此错误:

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.

它在 Apache 停止和重新启动后可以工作,但在几个小时后停止工作.

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

这是当前配置:

phpwkhtmltopdf - latest version 
CentOS 5.10
wkhtmltopdf 0.12.1

推荐答案

如果我也声明二进制文件,一切似乎都很棒..

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

$options = array( ...,"binary" => "/usr/local/bin/wkhtmltopdf")
$pdf = new Pdf($options);

这篇关于无法创建 PDF: sh: wkhtmltopdf: command not found的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆