I am currently trying to create a pdf doc with ~230 pages.
PHP Version: 7.0.33 mpdf Version: 8.0.8
1 page looks like the page in this fiddle (different data only): https://jsfiddle.net/hw90L2kd/ this is my php code:
setlocale(LC_TIME, "de_DE");
require_once "../../vendor/autoload.php";
require_once("../../020classes/Arrays.php");
require_once("../../020classes/c_DB.php");
$sql = "SELECT Verr_Rechnungen.*,pat.ZArt,pat.E_Nachrichten,adr.*
FROM Verr_Rechnungen
LEFT JOIN pat ON (Verr_Rechnungen.AdrNr=pat.AdrNrPat)
LEFT JOIN adr ON (Verr_Rechnungen.AdrNr=adr.AdrNr)
WHERE Rechnungsnummer >=".$_GET["rechnungsnummerstart"]." AND Rechnungsnummer <=".$_GET["rechnungsnummerende"]."
ORDER BY adr.FName,adr.VName,Land";
$rs = $db->prepare($sql);
$rs->execute(); //Im getting results from this
$mpdf = new \Mpdf\Mpdf(['tempDir' => __DIR__ . '/temp']);
while($row = $rs->fetch())
{
ob_start();
$mpdf->AddPage();
//here goes html page, which is generated with some php code
$stylesheet = file_get_contents('rechnungRGDruck.css'); //same css as in the fiddle
$mpdf->WriteHTML($stylesheet,1);
$html = ob_get_contents();
//send the captured HTML from the output buffer to the mPDF class for processing
$mpdf->WriteHTML($html,2);
ob_clean();
}
$mpdf->Output("rechnungen.pdf","D");
I have around 230 customers for which i each create a page inside this pdf but i always get a 500 - Internal Server Error when trying to create ALL the pages at once. If i limit my Query to, lets say 150, its no problem. I´ve already unlimited the php execution time and increased the memory size to 512M, to try if thats the reason for the problem - without succeding. And even if i use
error_reporting(-1); // reports all errors
ini_set("display_errors", "1"); // shows all errors
ini_set("log_errors", 1);
ini_set("error_log", "php-error.log");
at the top of the file i am not able to generate ANY error at all, no log, nothing. Only a 500 - Internal Server error. due to the information on this post php return 500 error but no error log i searched all the files of mpdf for the @ symbol, and replaced it with nothing (just to try out if i get any error after), but nothing again.
I´ve tried upgrading PHP to 7.3, but it didnt work aswell.
Does someone know why this happens?