"non well formed numeric value encountered" upon upgrading to 3.0.2

I got a message upon upgrading to 3.0.2 this morning it says:

WARNING: /home/forge/*URL/public/vendor/piwik/decompress/libs/PclZip/pclzip.lib.php(1797): Notice - A non well formed numeric value encountered - Piwik 3.0.1 - Please report this message in the Piwik forums: http://forum.piwik.org (please do a search first as it might have been reported already)

Any idea what the solution is ?

2 Likes

I am having the same issue. Might be related to the fact that I’m using PHP 7.1.1 already.

Thanks for all your work, community! I’m using Piwik rarely, but still…

My Piwik instance sits in a folder /piwik.

WARNING: /www/htdocs/xxxx/example.com/piwik/vendor/piwik/decompress/libs/PclZip/pclzip.lib.php(1797): Notice - A non well formed numeric value encountered - Piwik 3.0.0 - Please report this message in the Piwik forums: http://forum.piwik.org (please do a search first as it might have been reported already)

having this issue too. using PHP 7.1.2

I have the same issue, and my PHP version is 7.1.

Following line 1789 in vendor/piwik/decompress/libs/PclZip/pclzip.lib.php , add the following:
$v_memory_limit = substr($v_memory_limit, 0, -1); // drop G, M, or K suffix

The problem is caused by the ini_get(‘memory_limit’) function returning a string. PHP7 is picky about doing arithmetic on strings, where earlier versions just worked on the leading numeric part of the string.

According to the folks that should know (not me!), the problem is fixed in Piwik version 3. Therefore, I have to assume that you’re trying to use Piwik itself to upgrade from an earlier version to version 3.x.

Here are your options. The option you choose will depend on your individual circumstance.

  1. Downgrade PHP from version 7.x to a version earlier that 7, do the Piwik upgrade, and then revert PHP to what you were using before.
  2. Keep the version of PHP that you are using, and manually install Piwik version 3.x without using the upgrade feature built into Piwik.
  3. Keep the version of PHP you are using, and apply the above correction to your old Piwik installation (presumably it’s 2.17 or so) and try the upgrade built into Piwik. There should be no need to apply the correction after upgrading – the line number is likely to be wrong anyway.

Same here, PHP PHP Version 7.1.0

So do I, using PHP Version 7.1.3-3+0~20170325135815.21

@Thomas_L, @baseKomm

This was fixed in Convert to integer to avoid PHP warning by nztim · Pull Request #9 · piwik/component-decompress · GitHub and Updates piwik/decompress package by sgiehl · Pull Request #11351 · piwik/piwik · GitHub.

So updating to Piwik 3.0.2 (or later) solves this error.