Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
314 views
in Technique[技术] by (71.8m points)

php 7.1 - How to make mPDF 6.1 work with PHP 7.1.5

Developed on on a WAMP stack with PHP 5.6, then transferred to LAMP 7.1.5 Everything is working OK except for mPDF 6.1.0 which is giving the following:

Warning: A non-numeric value encountered in /var/sites/s/example.com/php_libs/vendor/mpdf/mpdf/mpdf.php on line 30648

Warning: A non-numeric value encountered in /var/sites/s/example.com/php_libs/vendor/mpdf/mpdf/mpdf.php on line 17074

Warning: A non-numeric value encountered in /var/sites/s/example.com/php_libs/vendor/mpdf/mpdf/mpdf.php on line 17075

Warning: A non-numeric value encountered in /var/sites/s/example.com/php_libs/vendor/mpdf/mpdf/mpdf.php on line 17093

I tried the solutions mentioned at Upgrade to PHP7.1 and MPDF show error - A non-numeric value encountered at line 30648 but that hasn't fixed it.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Edit mpdf.php, line 89, replace:

$errorlevel = error_reporting($errorlevel & ~E_NOTICE);

with:

$errorlevel = error_reporting($errorlevel & ~(E_NOTICE|E_WARNING));

Reason: https://stackoverflow.com/a/42044413/8284401


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...