[ZBX-11549] Notice "A non well formed numeric value encountered" in dashboard with PHP 7.1 Created: 2016 Dec 02 Updated: 2024 Apr 10 Resolved: 2017 May 14 |
|
Status: | Closed |
Project: | ZABBIX BUGS AND ISSUES |
Component/s: | Frontend (F) |
Affects Version/s: | 3.0.5, 3.2.1 |
Fix Version/s: | 3.0.10rc1, 3.2.7rc1, 3.4.0alpha1 |
Type: | Incident report | Priority: | Major |
Reporter: | Gunars Pujats (Inactive) | Assignee: | Unassigned |
Resolution: | Fixed | Votes: | 4 |
Labels: | dashboard, notices, php | ||
Remaining Estimate: | Not Specified | ||
Time Spent: | Not Specified | ||
Original Estimate: | Not Specified |
Issue Links: |
|
||||||||
Team: | |||||||||
Sprint: | Sprint 4, Sprint 5, Sprint 6, Sprint 7 | ||||||||
Story Points: | 0.5 |
Description |
PHP 7.1 produces notices in Zabbix dashboard view
|
Comments |
Comment by Gunars Pujats (Inactive) [ 2016 Dec 02 ] |
More info about PHP changes here: https://wiki.php.net/rfc/invalid_strings_in_arithmetic |
Comment by Thomas Stein [ 2017 Jan 06 ] |
Hi Devs. I see this too with my php-7.1 installation. Any patches i can test welcome. thanks and cheers |
Comment by Nikolay Kondratev [ 2017 Jan 11 ] |
The same problem for me. php 7.1 |
Comment by Sebastian Żmijewski [ 2017 Jan 17 ] |
File include/func.inc.php function str2mem($val) { $val = trim($val); $last = strtolower(substr($val, -1)); switch ($last) { case 'g': $val = (int) $val * 1024; /* falls through */ case 'm': $val = (int) $val * 1024; /* falls through */ case 'k': $val = (int) $val * 1024; } return $val; } |
Comment by Thomas Stein [ 2017 Jan 17 ] |
Thanks. Solves the problem for me. cheers |
Comment by Hugo [ 2017 Jan 25 ] |
trying Sebastian Żmijewski changes with php 7.1.1 I still got the warning. function str2mem($val) { $val = trim($val); $last = strtolower(substr($val, -1)); $val = substr_replace($val, "", -1); switch ($last) { case 'g': $val *= $val * 1024; /* falls through */ case 'm': $val *= $val * 1024; /* falls through */ case 'k': $val *= $val * 1024; } return $val; } |
Comment by Oleksandr Natalenko [ 2017 Mar 05 ] |
Still on 3.2.4. Fixed by adding "$val = (int)$val;" before switch statement. |
Comment by Gregory Chalenko [ 2017 Mar 20 ] |
In PHP7 strings containing hexadecimal numbers are no longer considered to be numeric. |
Comment by Gregory Chalenko [ 2017 Mar 20 ] |
Fixed in: svn://svn.zabbix.com/branches/dev/ZBX-11549 r66565 |
Comment by tarmo [ 2017 May 07 ] |
Can anyone please explain how to apply this fix provided by Gregory Chalenko ? |
Comment by Oleksandr Natalenko [ 2017 May 07 ] |
tarmo, it's the same fix I've suggested previously Wait for new package or go and edit relevant file directly. |
Comment by Gregory Chalenko [ 2017 May 09 ] |
Fixed in:
|