0

我正在使用 freegeoip 为我的客户获取 IP 地址的地理位置。一切正常,但突然在顶部区域的网站上显示一个错误,说,

严重性:警告消息:file_get_contents(http://freegeoip.net/json/39.37.152.1):无法打开流:HTTP 请求失败!HTTP/1.1 403 禁止

当我查看该问题时,我发现网站点击限制已超出,这就是显示错误的原因。

这是我的网站http://www.acssynergy.com/ 有没有人知道这个错误会持续显示它已经 24 小时并且错误仍然存​​在

4

1 回答 1

1

目前,如果我检查http://freegeoip.net/json/84.236.112.202

结果是:

ip  "84.236.112.202"
country_code    "HU"
country_name    "Hungary"
region_code "BU"
region_name "Budapest"
city    "Budapest"
zip_code    "1012"
time_zone   "Europe/Budapest"
latitude    47.5
longitude   19.0833
metro_code  0

同时,您的网站http://www.acssynergy.com/给了我:

A PHP Error was encountered

Severity: Warning

Message: file_get_contents(http://freegeoip.net/json/84.236.112.202): failed to open stream: HTTP request failed! HTTP/1.1 403 Forbidden

Filename: controllers/Welcome.php

Line Number: 42

Backtrace:

File: /hermes/bosnacweb01/bosnacweb01aw/b2306/ipg.acsadminnet/acssynergy/application/controllers/Welcome.php
Line: 42
Function: file_get_contents

File: /hermes/bosnacweb01/bosnacweb01aw/b2306/ipg.acsadminnet/acssynergy/index.php
Line: 309
Function: require_once

从 freegeoip 检查答案标题:

CF-RAY  3b0174ce90247f00-BUD
Connection  keep-alive
Content-Encoding    gzip
Content-Type    application/json
Date    Thu, 19 Oct 2017 05:49:49 GMT
Server  cloudflare-nginx
Set-Cookie  __cfduid=dc13fe607037f5a784ef21ffae22ab31d1508392189; expires=Fri, 19-Oct-18 05:49:49 GMT; path=/; domain=.freegeoip.net; HttpOnly
Transfer-Encoding   chunked
Vary    Origin
X-Database-Date Thu, 05 Oct 2017 01:49:14 GMT
X-Ratelimit-Limit   15000
X-Ratelimit-Remaining   14999
X-Ratelimit-Reset   3600

请检查您的X-Ratelimit-Remaining. 如果为 0,您将不得不等到X-Ratelimit-Reset从该站点获取值(未测试)。如果您检查,您X-Ratelimit-Reset将知道何时可以再次连接。

另一种更改 geoip 提供商的解决方案。此处的详细信息:freegeoip 不再起作用

于 2017-10-19T06:04:46.723 回答