Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

php内存查询方式,有时不返回结果 #301

Open
911yy opened this issue May 13, 2023 · 3 comments
Open

php内存查询方式,有时不返回结果 #301

911yy opened this issue May 13, 2023 · 3 comments

Comments

@911yy
Copy link

911yy commented May 13, 2023

使用php 内存查询方式,经常碰到返回结果为null的情况,一开始以为是地址库中没有采集,后来在使用c#语言查询时使用相同的xdb库文件,查询时会有结果。
几个示例IP地址:
222.216.106.191
222.216.131.251
223.104.195.122
查询了ip.merge.txt文件中确实包含这几个对应的ip地址段,麻烦看下是什么问题呢?

@lionsoul2014
Copy link
Owner

➜ ip2region git:(master) php binding/php/search_test.php --db=./data/ip2region.xdb
ip2region xdb searcher test program, cachePolicy: vectorIndex
type 'quit' to exit
ip2region>> 222.216.106.191
{region: 中国|0|广西|南宁市|电信, ioCount: 4, took: 0.04517 ms}
ip2region>> 222.216.131.251
{region: 中国|0|广西|南宁市|电信, ioCount: 7, took: 0.03931 ms}
ip2region>> 223.104.195.122
{region: 中国|0|山东省|潍坊市|移动, ioCount: 8, took: 0.02832 ms}
ip2region>>

@911yy
Copy link
Author

911yy commented May 13, 2023

ip2region xdb searcher test program, cachePolicy: vectorIndex
type 'quit' to exit
ip2region>> 222.216.106.191
{region: , ioCount: 0, took: 0.14819 ms}
ip2region>> 222.216.131.251
{region: , ioCount: 0, took: 0.10913 ms}
ip2region>> 223.104.195.122
{region: , ioCount: 0, took: 0.10181 ms}
新下载的包,调用测试,也是返回空,真是奇怪了,和解压程序有关还是和系统环境有关系?

@911yy
Copy link
Author

911yy commented May 13, 2023

已经基本确定和php版本有关系,前面测试使用的是php 5.6.3,使用php 8版本测试没有问题。
大佬能不能帮忙看下php 5.6.3下如何解决这个问题呢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants