Php dompdf无法呈现超过10页的PDF

Php dompdf无法呈现超过10页的PDF,php,dompdf,Php,Dompdf,目前,我正在使用dompdf生成PDF,但它的呈现页面不超过10页,每当我尝试使用10页以上的页面时,它都会返回空白页面并给出以下错误 致命错误:第4927行/home/my_file_path/dompdf/vendor/dompdf/dompdf/lib/Cpdf.php中允许的内存大小为33554432字节(试图分配2358字节) 下面是使用dompdf <?php require '../dompdf/vendor/autoload.php'; // reference the

目前,我正在使用
dompdf
生成PDF,但它的呈现页面不超过10页,每当我尝试使用10页以上的页面时,它都会返回空白页面并给出以下错误

致命错误
第4927行/home/my_file_path/dompdf/vendor/dompdf/dompdf/lib/Cpdf.php中允许的内存大小为33554432字节(试图分配2358字节)

下面是使用
dompdf

<?php

require '../dompdf/vendor/autoload.php';

// reference the Dompdf namespace
use Dompdf\Dompdf;

// instantiate and use the dompdf class

$dompdf = new Dompdf();
//$custom_labels=ob_get_flush();
$dompdf->loadHtml($custom_labels);

// (Optional) Setup the paper size and orientation
$dompdf->setPaper('A4', 'portrait');

// Render the HTML as PDF

$dompdf->render();
echo "<pre>";print_r($custom_labels);
exit();


// Output the generated PDF to Browser
// $dompdf->stream();

// save file to location
$output = $dompdf->output();
$customLabel = "../admin/pdf/label/custom_".$orderComplete[0].".pdf";
if(!empty($orderComplete))
{
    file_put_contents($customLabel, $output);
    $relPath[] = $customLabel;
}

?>

您必须增加此处的内存限制

如果可以访问
php.ini
,则可以更改以下参数

 ini_set('memory_limit', '64M');
或者,您可以尝试仅通过在开头添加该脚本来更改该脚本


我收到新错误:警告:出于安全原因,ini_set()已被禁用。因此,您必须访问
php.ini
文件并更改其中的值。在php.ini中,显示内存限制本地值为32M,主值为512M。然后更改本地值。我们在本地设置了值512M,但在给定空白页的情况下仍然无法工作
 ini_set('memory_limit', '64M');