0

I update php7.1 to php7.2.1 (PHP 7.2.1 (cli)) my laravel pdf not generated show below errorr:

(1/1) ErrorException

A non-numeric value encountered
in mpdf.php (line 30648)

at HandleExceptions->handleError(
    2, 
    'A non-numeric value encountered', 
    '/opt/lampp/htdocs/mysite/vendor/mpdf/mpdf/mpdf.php', 
    30648, 
    array(
        'size' => 0, 
        'maxsize' => 190.00155555555551245561218820512294769287109375, 
        'fontsize' => 3.704166666666667051543981870054267346858978271484375,
        'usefontsize' => false)
    )
in mpdf.php (line 30648)

enter image description here

Finwe
  • 6,372
  • 2
  • 29
  • 44
matinict
  • 2,411
  • 2
  • 26
  • 35
  • re run: `composer require mpdf/mpdf` & then `composer update` – Option Feb 26 '18 at 08:37
  • i got solution https://stackoverflow.com/questions/45101160/how-to-make-mpdf-6-1-work-with-php-7-1-5 Edit mpdf.php, line 89, replace: $errorlevel = error_reporting($errorlevel & ~E_NOTICE); with: $errorlevel = error_reporting($errorlevel & ~(E_NOTICE|E_WARNING)); – matinict Oct 29 '18 at 10:08

1 Answers1

1

Based on the error message, you are using mPDF 6.x which is not compatible with PHP 7.2 (and not entirely with PHP 7.1 for that matter).

You should upgrade to mPDF 7 which is officially supported up to PHP 7.2.

Finwe
  • 6,372
  • 2
  • 29
  • 44