Howdy!
I'm trying to get our PHPIPAM install up and running, and I'm having a problem with the visual inventory. It keeps saying:
Warning: gmp_add(): Unable to convert variable to GMP - wrong type in /var/www/html/phpipam/site/ipaddr/ipAddressPrintVisual.php on line 33
I have the IP Visual Display Limit let to /22 (and I've tried it at /23 and /24) and it keeps giving me that error.
My subnets are all set at /24.
Any help would be awesome!
Thanks!
Anonymous
Hey - just pinging this one to see if anyone is around, or I added the case in right.
Thanks!!!
Can you try casting the variable to int?
after
add
Thank you for the reply!
I added that in, and now under Visual Display its just blank. No warning - its just blank. That section of my .php file now reads:
$max = MaxHosts($SubnetDetails['mask'], $type);
$max = $SubnetDetails['subnet'] + $max;
$max = (int) $max;
Hi.
I have the same problem on version [v1.1] rev010.
I tried casting the variable to int as Miha told and after that I have no errors but nothing is shown in the Visual subnet display.
Do you by any chance have the 32bit system (i386)?
It seems on 32bit systems integer is too high.
Remove casting and add this instead:
This seems to work:
(add it after)
Last edit: Miha Petkovsek 2015-01-02
I have the same issue here.
My ipAddressPrintVisual.php file looks like:
# get max hosts
$max = MaxHosts($SubnetDetails['mask'], $type);
$max = $SubnetDetails['subnet'] + $max;
$max = gmp_strval(gmp_and("0xffffffff", $max));
I do have the error now on line 17.
Hello,
Same error in my environement: Debian GNU/Linux 7.6 (wheezy) 32bits
Alex
I tried adding:
but didn't have any luck. This is the message I am now receiving:
Warning: gmp_and(): Unable to convert variable to GMP - wrong type in /var/www/site/ipaddr/ipAddressPrintVisual.php on line 17
Try changing to this, $max gets translated to float:
brm
Casting $max as int as suggested above worked for me. Thanks a bunch Miha!
Worked for me too! Thanks too!
Hi,
I use phpipam-1.1.010 on a 32bit-ubuntu-system, too, and also had this problem.
Because the posts above show no exact solution here is mine formatted as a patch:
~~~~~~
--- ipAddressPrintVisual.php.orig 2015-02-10 11:53:29.680966189 +0100
+++ ipAddressPrintVisual.php 2015-02-10 11:56:52.520817175 +0100
@@ -14,6 +14,7 @@
# get max hosts
$max = MaxHosts($SubnetDetails['mask'], $type);
$max = $SubnetDetails['subnet'] + $max;
~~~~~~~
THX for the support!
View and moderate all "support-requests Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Support Requests"
Thanks you Miha Petkovsek and Martin Dummer.
Kennedy - Brazil
Ubuntu system 14.04 LTS 32 bits
View and moderate all "support-requests Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Support Requests"
This is worked for me . Thanks Miha.
View and moderate all "support-requests Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Support Requests"
(int) did the trick, thanks!