[2] ErrorException in HomeBaseController.php line 435

file_get_contents(http://www.geoplugin.net/json.gp?ip=54.198.34.207): failed to open stream: HTTP request failed! HTTP/1.1 429 Too Many Requests

  1. $return_data = array('country'=>'', 'city'=>'');
  2. $timeout=array(
  3. 'http'=>array(
  4. 'timeout'=>5
  5. )
  6. );
  7. $ctx = stream_context_create($timeout);
  8. // dd($ip_addr,0,$ctx);
  9. $text = file_get_contents('http://www.geoplugin.net/json.gp?ip='.$ip_addr,false,$ctx);
  10. $ip_data = @json_decode($text);
  11. // $ip_data = @json_decode(file_get_contents("http://www.geoplugin.net/json.gp?ip=".$ip_addr));
  12. if($ip_data && $ip_data->geoplugin_countryName != null)
  13. {
  14. $return_data['country'] = $ip_data->geoplugin_countryCode; // 输出的是简写 US CN
  15. $return_data['city'] = $ip_data->geoplugin_city;
  16. }

Call Stack

  1. in HomeBaseController.php line 435
  2. at Error::appError(2, 'file_get_contents(ht...', '/www/wwwroot/www.tou...', 435, ['ip_addr' => '54.198.34.207', 'return_data' => ['country' => '', 'city' => ''], 'timeout' => ['http' => ['timeout' => 5]], ...])
  3. at file_get_contents('http://www.geoplugin...', false, resource) in HomeBaseController.php line 435
  4. at HomeBaseController->getLocationInfoByIp('54.198.34.207') in HomeBaseController.php line 308
  5. at HomeBaseController->viewCommon() in HomeBaseController.php line 83
  6. at HomeBaseController->__construct(object(Request))
  7. at ReflectionClass->newInstanceArgs([object(Request)]) in App.php line 359
  8. at App::invokeClass('app\home\controller\...') in Loader.php line 479
  9. at Loader::controller('Index', 'controller', true, 'Empty') in App.php line 581
  10. at App::module(['', null, null], ['app_host' => '', 'app_debug' => true, 'app_trace' => false, ...], false) in App.php line 456
  11. at App::exec(['type' => 'module', 'module' => ['', null, null]], ['app_host' => '', 'app_debug' => true, 'app_trace' => false, ...]) in App.php line 139
  12. at App::run() in start.php line 19
  13. at require('/www/wwwroot/www.tou...') in index.php line 33

Environment Variables

GET Data

lang
en-us
POST Data
empty
Files
empty

Cookies

website_id
2
think_var
en-us
website_dir
en
think_web
US

Session

think
{ "shoppingSessionId": "22614098c4dd336dded0ab7d2ee60dfa1260a008" }

Server/Request Data

USER
www
HOME
/home/www
SCRIPT_NAME
/index.php
REQUEST_URI
/?lang=en-us
QUERY_STRING
lang=en-us
REQUEST_METHOD
GET
SERVER_PROTOCOL
HTTP/2.0
GATEWAY_INTERFACE
CGI/1.1
REMOTE_PORT
43082
SCRIPT_FILENAME
/www/wwwroot/www.touchbeauty.co.jp/index.php
SERVER_ADMIN
webmaster@example.com
CONTEXT_DOCUMENT_ROOT
/www/wwwroot/www.touchbeauty.co.jp/
CONTEXT_PREFIX
REQUEST_SCHEME
https
DOCUMENT_ROOT
/www/wwwroot/www.touchbeauty.co.jp/
REMOTE_ADDR
54.198.34.207
SERVER_PORT
443
SERVER_ADDR
182.161.38.2
SERVER_NAME
en.touchbeauty.com
SERVER_SOFTWARE
Apache
SERVER_SIGNATURE
<address>Apache Server at en.touchbeauty.com Port 443</address>
LD_LIBRARY_PATH
/www/server/apache/lib:/www/server/apache/lib
PATH
/www/server/panel/pyenv/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/root/bin
HTTP_HOST
en.touchbeauty.com
HTTP_REFERER
https://www.touchbeauty.com/prod_view.aspx?TypeId=84&Id=255&FId=t3:84:3
HTTP_USER_AGENT
claudebot
HTTP_ACCEPT
*/*
proxy-nokeepalive
1
H2_STREAM_TAG
20068-988-1
H2_STREAM_ID
1
H2_PUSHED_ON
H2_PUSHED
H2_PUSH
off
H2PUSH
off
HTTP2
on
SSL_TLS_SNI
en.touchbeauty.com
HTTPS
on
HTTP_AUTHORIZATION
FCGI_ROLE
RESPONDER
PHP_SELF
/index.php
REQUEST_TIME_FLOAT
1711707891.6493
REQUEST_TIME
1711707891
HTTP_ACCEPT_LANGUAGE
en-us
Environment Variables
empty

ThinkPHP Constants

APP_PATH
/www/wwwroot/www.touchbeauty.co.jp/app/
WEB_ROOT
/www/wwwroot/www.touchbeauty.co.jp/
CONF_PATH
/www/wwwroot/www.touchbeauty.co.jp/config/
RUNTIME_PATH
/www/wwwroot/www.touchbeauty.co.jp/runtime/
UPLOAD_PATH
/www/wwwroot/www.touchbeauty.co.jp/upload/
PUBLIC_PATH
/www/wwwroot/www.touchbeauty.co.jp/public/
QDWEB_VERSION
v2.1.24
NOW_TIME
1711707891
THINK_VERSION
5.0.24
THINK_START_TIME
1711707891.6508
THINK_START_MEM
419888
EXT
.php
DS
/
THINK_PATH
/www/wwwroot/www.touchbeauty.co.jp/thinkphp/
LIB_PATH
/www/wwwroot/www.touchbeauty.co.jp/thinkphp/library/
CORE_PATH
/www/wwwroot/www.touchbeauty.co.jp/thinkphp/library/think/
TRAIT_PATH
/www/wwwroot/www.touchbeauty.co.jp/thinkphp/library/traits/
ROOT_PATH
/www/wwwroot/www.touchbeauty.co.jp/
EXTEND_PATH
/www/wwwroot/www.touchbeauty.co.jp/extend/
VENDOR_PATH
/www/wwwroot/www.touchbeauty.co.jp/vendor/
LOG_PATH
/www/wwwroot/www.touchbeauty.co.jp/runtime/log/
CACHE_PATH
/www/wwwroot/www.touchbeauty.co.jp/runtime/cache/
TEMP_PATH
/www/wwwroot/www.touchbeauty.co.jp/runtime/temp/
CONF_EXT
.php
ENV_PREFIX
PHP_
IS_CLI
false
IS_WIN
false
FILTER_VALIDATE_BOOL
258
USER_STATUS_NONE
0
USER_STATUS_NORMAL
1
USER_STATUS_DISABLED
2
OSS_IMG_WEBP
?x-oss-process=image/format,webp
A___A__AA_
A___A__AAA
A__AAAA_A
49
A___A__A__
A___A__A_A
A__AAAAAA
A_A______
A_AA__AA_
A_AA__AAA
AAA__AAAA
AAA_A____
AAA__A_A_
AAA__A_AA
A_AAAAA__
A_AAAAA_A