0

我在我的 Symfony 项目中使用 wkhtmltopdf,一切都在我的电脑上运行。但是当我将我的项目放在 CentOS 服务器上时,我不再能够创建 pdf 文件。

我正在使用这一行,但在 linux 服务器上无法执行 .exe 文件:

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

我试图下载 CentOS 的 .rpm 文件,但我仍然有同样的错误。

4

1 回答 1

0

我通过安装 wkhtmltopdf 解决了这个问题,就像在这个链接中解释的那样: http ://www.kitpages.fr/fr/cms/182/installer-wkhtmltopdf-sous-centos-et-debian

之后我可以在 CentOS 中给出 wkhtmltopdf 的路径,即:/opt/wkhtmltopdf/bin/wkhtmltopdf

该行现在是这样的:

$snappy = new Pdf('/opt/wkhtmltopdf/bin/wkhtmltopdf');
于 2017-07-21T14:15:16.833 回答