duandiao3961 2019-04-09 16:42
浏览 40

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

I'm trying to get the latest GeoIP package to work with my local wampserver. I have all of the files - autoload, databases, etc. - setup, at least as far as I know. The code I am using is:

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 . "
"); // 'US'

The above outputs

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

I'm using php 5.6. There aren't any errors or warnings displayed anywhere that I can find. Does anyone know what I am missing or how to troubleshoot this?

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 素材场景中光线烘焙后灯光失效
    • ¥15 请教一下各位,为什么我这个没有实现模拟点击
    • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
    • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
    • ¥20 有关区间dp的问题求解
    • ¥15 多电路系统共用电源的串扰问题
    • ¥15 slam rangenet++配置
    • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
    • ¥15 ubuntu子系统密码忘记
    • ¥15 保护模式-系统加载-段寄存器