GeoIP显示实际代码,而不是数据库的结果

时间:2019-04-09 16:42:12

标签: php geoip

我正在尝试获取最新的GeoIP软件包以与本地wampserver一起使用。我拥有所有文件-自动加载,数据库等-设置,至少据我所知。我正在使用的代码是:

require_once 'GeoIP2/autoload.php';
use GeoIp2/Database/Reader;

$reader = new Reader('GeoIP2/GeoLite2-City.mmdb');
$record = $reader->city('128.101.101.101');
print($record->country->isoCode . "\n"); // 'US'

以上输出

city('128.101.101.101'); 
print($record->country->isoCode . "\n"); 
// 'US' 

我正在使用php 5.6。我可以找到的任何地方都没有显示任何错误或警告。有人知道我缺少什么或如何解决这个问题吗?

0 个答案:

没有答案