两个不同的服务器返回不同的纬度和经度。
我将GeoIp安装到了两台服务器上:
apt-get install geoip-database geoip-database-extra php-geoip
制作测试脚本:
$ip_address = ...;
$info = geoip_record_by_name($ip_address);
var_dump($info);
对于某些Ip,其中一台服务器返回整数而不是float,例如:
ip:12.219.119.222
server1: [latitude] => 38 [longitude] => -97
server2: [latitude] => 37.750999450684 [longitude] => -97.821998596191
ip:172.113.184.205
server1: [latitude] => 38 [longitude] => -97
server2: [latitude] => 33.660301208496 [longitude] => -117.99919891357
ip:91.152.191.186
server1: [latitude] => 60.175598144531 [longitude] => 24.934200286865
server2: [latitude] => 60.175598144531 [longitude] => 24.934200286865
server1使用Ubuntu 16.04 server2使用Ubuntu 17.10
如何解决?