Title: Issues with PHP warnings and errors
Last modified: May 21, 2018

---

# Issues with PHP warnings and errors

 *  Resolved [neotrope](https://wordpress.org/support/users/neotrope/)
 * (@neotrope)
 * [8 years ago](https://wordpress.org/support/topic/issues-with-php-warnings-and-errors/)
 * Hi, folks
    we have been getting some errors with PHP 7.2.5 and I have rolled 
   back to 7.1x to see if that might solve it; Apache, Plesk/Onyx (fully patched),
   HTTP/2.
 * Anyway — e.g.,
    `AH01071: Got error 'PHP message: PHP Warning: A non-numeric 
   value encountered in /var/www/vhosts/DOMAIN.com/httpdocs/wire/assets/plugins/
   pdf-print/mpdf/mpdf.php on line 30649\n'`

Viewing 7 replies - 1 through 7 (of 7 total)

 *  Thread Starter [neotrope](https://wordpress.org/support/users/neotrope/)
 * (@neotrope)
 * [8 years ago](https://wordpress.org/support/topic/issues-with-php-warnings-and-errors/#post-10304629)
 * apparently this line in mpdf.php
 *     ```
       		} else
       			$size *= (25.4 / $this->dpi); //nothing == px
       ```
   
 * Changing to php 7.1 still generating error on EVERY load; so not issue with 7.1
   vs 7.2.5 apparently.
 *  Thread Starter [neotrope](https://wordpress.org/support/users/neotrope/)
 * (@neotrope)
 * [8 years ago](https://wordpress.org/support/topic/issues-with-php-warnings-and-errors/#post-10310557)
 * I have not tried to hack this, but it seems like updating to v7.0 vs 6.1 of mPDF
   might be advisable ?
 * With PDF & Print by BestWebSoft / Version: 2.0.2
 * ref:
 *     ```
       // Software: mPDF, Unicode-HTML Free PDF generator                              *
       // Version:  6.1 
       ```
   
 * version 7.0.0 works up to PHP 7.2 ( < 7.3 )
    ref [https://mpdf.github.io/](https://mpdf.github.io/)
    -  This reply was modified 8 years ago by [neotrope](https://wordpress.org/support/users/neotrope/).
 *  Plugin Author [bestwebsoft](https://wordpress.org/support/users/bestwebsoft/)
 * (@bestwebsoft)
 * [8 years ago](https://wordpress.org/support/topic/issues-with-php-warnings-and-errors/#post-10317892)
 * Hi,
 * Thank you for contacting us and for the suggested solution.
 * Our PDF & Print plugin’s work is based on mPDF library version 6.1.
    We are planning
   to update the mPDF library in the future. At the moment we cannot provide any
   terms when it will be implemented.
 * Please let us know if you have any additional questions.
 *  Thread Starter [neotrope](https://wordpress.org/support/users/neotrope/)
 * (@neotrope)
 * [8 years ago](https://wordpress.org/support/topic/issues-with-php-warnings-and-errors/#post-10318928)
 * Thanks for reply.
    Just for laughs, I’m going to try rolling in v7 to the plugin
   to see if works or not.
 * In our case, we have a news portal with 15,000 pages of content going back to
   2005, even though I have pruned about 1,000 totally obsolete items this year.
   Problem for us, is BING likes to ping our pages as we used to have static .txt
   and .pdf files in addition to .shtml – so when we went to .php – we retired and
   redirected all the old pdf and txt URLs, but now with a “save pdf’ button (we’re
   using our own bootstrap button, not function or shortcode from plugin) — BING
   is “pinging” the PDF and archiving it even with a rel=nofollow — so were getting
   a *ton* of errors every day, as you can imagine once we moved to PHP 7.2.5 which
   we had to do for our ecommerce system ….
 * Anyway — can’t go back to PHP 5.6, so I love the plugin, and will see if mPDF
   7x works with the plugin as-is, and report back.
 * Thanks again for the awesome plugin!
 *  Thread Starter [neotrope](https://wordpress.org/support/users/neotrope/)
 * (@neotrope)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/issues-with-php-warnings-and-errors/#post-10530539)
 * HI,
    I was not able to ‘hack’ the update due to how you’re integrating that. 
   And also got sidetracked moving our server to HTTP/2 + ALPN.
 * To revisit this… any ETA on updating this, or even starting with the PRO version,
   for PHP 7 compatibility. We’re running PHP 7.2 and want to use this again, and
   I was about to buy the pro version when we ran into the massive error logs issue.
 * Thanks for your time – I imagine you might have better things to do, but we’d
   love to see a PHP 7 ready version of this, as it’s super helpful for our company!
 * Christopher
 *  [Muxelmann](https://wordpress.org/support/users/muxelmann/)
 * (@muxelmann)
 * [7 years, 9 months ago](https://wordpress.org/support/topic/issues-with-php-warnings-and-errors/#post-10631732)
 * Hi, I have the same issue as it seems:
 * I am using Version 2.0.2 and have PHP 7.2 (hosted on 1&1) when I got this error.
   I had to downgrade to PHP 7.0 to no longer get the messages (and a properly formatted
   PDF). The warnings I see in the generated PDF file when using PHP 7.2 are:
 *     ```
       <br />
       <b>Warning</b>:  A non-numeric value encountered in <b>/xxx/wordpress/wp-content/plugins/pdf-print/mpdf/mpdf.php</b> on line <b>30649</b><br />
       <br />
       <b>Warning</b>:  A non-numeric value encountered in <b>/xxx/wordpress/wp-content/plugins/pdf-print/mpdf/mpdf.php</b> on line <b>30649</b><br />
       <br />
       <b>Warning</b>:  A non-numeric value encountered in <b>/xxx/wordpress/wp-content/plugins/pdf-print/mpdf/Tag.php</b> on line <b>1889</b><br />
       <br />
       <b>Warning</b>:  A non-numeric value encountered in <b>/xxx/wordpress/wp-content/plugins/pdf-print/mpdf/Tag.php</b> on line <b>1889</b><br />
       <br />
       <b>Warning</b>:  A non-numeric value encountered in <b>/xxx/wordpress/wp-content/plugins/pdf-print/mpdf/Tag.php</b> on line <b>1889</b><br />
       <br />
       <b>Warning</b>:  A non-numeric value encountered in <b>/xxx/wordpress/wp-content/plugins/pdf-print/mpdf/Tag.php</b> on line <b>1889</b><br />
       <br />
       <b>Warning</b>:  A non-numeric value encountered in <b>/xxx/wordpress/wp-content/plugins/pdf-print/mpdf/Tag.php</b> on line <b>2006</b><br />
       <br />
       <b>Warning</b>:  A non-numeric value encountered in <b>/xxx/wordpress/wp-content/plugins/pdf-print/mpdf/Tag.php</b> on line <b>2006</b><br />
       <br />
       <b>Warning</b>:  A non-numeric value encountered in <b>/xxx/wordpress/wp-content/plugins/pdf-print/mpdf/mpdf.php</b> on line <b>6387</b><br />
       <br />
       <b>Warning</b>:  A non-numeric value encountered in <b>/xxx/wordpress/wp-content/plugins/pdf-print/mpdf/Tag.php</b> on line <b>2003</b><br />
       <br />
       <b>Warning</b>:  A non-numeric value encountered in <b>/xxx/wordpress/wp-content/plugins/pdf-print/mpdf/mpdf.php</b> on line <b>6387</b><br />
       <br />
       <b>Warning</b>:  A non-numeric value encountered in <b>/xxx/wordpress/wp-content/plugins/pdf-print/mpdf/Tag.php</b> on line <b>2003</b><br />
       <br />
       <b>Warning</b>:  A non-numeric value encountered in <b>/xxx/wordpress/wp-content/plugins/pdf-print/mpdf/mpdf.php</b> on line <b>6387</b><br />
       ```
   
 * We are also inclined to buy a license for this plugin for our website, but if
   this bug cannot be fixed by 12/2018 (which is when the 1&1 support for PHP 7.0
   expires) then I’d hesitate to do so.
 * PS: The print function seems to work fine in PHP 7.2 (no visible warnings at 
   least). So I’d guess the bug is somewhere in the PDF-related code.
 *  [Muxelmann](https://wordpress.org/support/users/muxelmann/)
 * (@muxelmann)
 * [7 years, 9 months ago](https://wordpress.org/support/topic/issues-with-php-warnings-and-errors/#post-10638914)
 * So, I modified the plugin to simply hide all errors and warnings by inserting`
   error_reporting(0);` at the beginning of the _pdf-print.php_ file. I suppose `
   error_reporting(E_ERROR);` would also work, because that still enables error 
   messages, but hides all warnings.
 * PS: this is merely a **quick fix** and not a solution to the bug in the long 
   term…

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Issues with PHP warnings and errors’ is closed to new replies.

 * ![](https://ps.w.org/pdf-print/assets/icon-256x256.gif?rev=2580392)
 * [PDF & Print by BestWebSoft - WordPress Posts and Pages PDF Generator Plugin](https://wordpress.org/plugins/pdf-print/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/pdf-print/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/pdf-print/)
 * [Active Topics](https://wordpress.org/support/plugin/pdf-print/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/pdf-print/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/pdf-print/reviews/)

## Tags

 * [mPDF](https://wordpress.org/support/topic-tag/mpdf/)

 * 7 replies
 * 3 participants
 * Last reply from: [Muxelmann](https://wordpress.org/support/users/muxelmann/)
 * Last activity: [7 years, 9 months ago](https://wordpress.org/support/topic/issues-with-php-warnings-and-errors/#post-10638914)
 * Status: resolved