在Windows中安装Dompdf

时间:2014-08-03 15:35:39

标签: dompdf

我是由作曲家安装DOMPDF但是当我试图运行这段代码时

<?php
require 'vendor/autoload.php';
require_once("dompdf_config.inc.php");

$html =
'<html><body>'.
'<p>Put your html here, or generate it with your favourite '.
'templating system.</p>'.
'</body></html>';

$dompdf = new DOMPDF();
$dompdf->load_html($html);
$dompdf->render();
$dompdf->stream("sample.pdf");

它给了我这个FatalErrorException失败打开所需&#39; vendor / autoload.php&#39; 我将DOMPDF_ENABLE_AUTOLOAD更改为false

我想我安装了DOMPDF错误,所以如何逐步安装它 或者如何解决这个问题

1 个答案:

答案 0 :(得分:0)

Setting up the Dompdf (a pdf generation package in php) in XAMPP in windows environment can sometimes be an issue.

错误消息是由内部扩展之间的冲突引起的。所以你需要从配置文件中取消Domdocument扩展。extension = php_domxml.dll

dompdf uses PDFLib by default if it is available in the system and PDFLib is a commercial package which is not available by default in the system but its extention is enabled in php.ini by default in the system.

请查看here