geoip_country_code_by_name host not found的解决办法

NOCO发布于 分类 PHP

12天前 有1个用户阅读过

某个英文网站的一个模块用到了PHP扩展geoip的一个方法geoip_country_code_by_name,后来从日志中发现偶尔有国外IP访问出现500错误,仔细对照日志发现是geoip_country_code_by_name提示host not found导致的,字面意思就是IP数据库没有找到对应的数据就对了,通过@geoip_country_code_by_name问题解决。

具体原因以及相关总结:

php.net官网关于geoip_country_code_by_name的返回值描述:

Returns the two letter ISO country code on success, or FALSE if the address cannot be found in the database.

错误控制运算符

PHP 支持一个错误控制运算符:@。当将其放置在一个 PHP 表达式之前,该表达式可能产生的任何错误信息都被忽略掉。

-- The End --

本文标题: geoip_country_code_by_name host not found的解决办法

本文地址: https://seonoco.com/blog/geoip_country_code_by_name-host-not-found

本文是否有所帮助?
点赞 0
感谢支持
0
多谢反馈
评论 0
打赏

支持微信/支付宝

评论

网友