0
Hi,
I have in my machine the mPdf v.7 that works normally, but when I go up, it’s giving an error that seems to be related to deprecated call methods.
Deprecated: Methods with the same name as their class will not be constructors in a Future version of PHP; mPDF has a deprecated constructor in /home/meusite/public_html/folder/mpdf7/mpdf.php on line 89
The point is that in my machine I have the PHP 7.3 and online is 7.1, I mean, my PHP is more current and still works normally.
I tried to:
public function __construct(mPDF $mpdf){
$this->mpdf = $mpdf;
}
And gave another error, related to using 'public''
My code that works offline:
<?php
include('mpdf7/mpdf.php');
ob_start();
?>
<html> ... </html>
<?php
$html = ob_get_clean();
$mpdf = new mPDF();
$mpdf->SetDisplayMode('fullpage');
$mpdf->WriteHTML($html);
$mpdf->allow_output_buffering = true;
$mpdf->Output('documento.pdf', 'I');
exit;
?>
Buddy, take a look at this link, maybe it’ll help you.
– smourao
In the link, explains that they are for future versions of PHP, only that on my machine PHP is more current than on the online server and even so works :(
– Anderson Felipe
[SOLVED] These are the PHP requirements that must be configured on the server, as described in: https://packagist.org/packages/mpdf/mpdf
– Anderson Felipe