[2] ErrorException in global.php line 661

file_get_contents(http://www.wdunncpa.com/api.php/index/xiangmu?categoryid=38&category=测试): failed to open stream: HTTP request failed! HTTP/1.1 502 Bad Gateway

  1. foreach ($param as $key => $value) {
  2. $apiurl.=$key."=".$value.'&';
  3. }
  4. $apiurl = rtrim($apiurl,'&');
  5. // echo $apiurl;die;
  6. // $time1 = microtime(true);
  7. // $datatext = '';
  8. $file_open_time = time();
  9. $datatext=file_get_contents($apiurl);
  10. $file_open_time = time() - $file_open_time;
  11. // 写入接口查询记录 频次 运行时间
  12. $file_name = RUNTIME_PATH.'cache'.date('Y-m-d',time()).'.txt';
  13. $my_file = fopen($file_name, "a");
  14. $file_content = date('Y-m-d H:i:s',time())." $api"." $file_open_time\n";
  15. fwrite($my_file, $file_content);
  16. fclose($my_file);
  17. // $handle = fopen($apiurl,'r');
  18. // do {

Call Stack

  1. in global.php line 661
  2. at Error::appError(2, 'file_get_contents(ht...', '/alidata1/wwwroot/ww...', 661, ['api' => 'index/xiangmu', 'param' => ['categoryid' => '38', 'category' => '测试'], 'location' => ['data'], ...])
  3. at file_get_contents('http://www.bjraxfxx....') in global.php line 661
  4. at apidata('index/xiangmu', ['categoryid' => '38', 'category' => '测试']) in Index.php line 92
  5. at Index->index()
  6. at ReflectionMethod->invokeArgs(object(Index), []) in App.php line 235
  7. at App::invokeMethod([object(Index), 'index']) in App.php line 354
  8. at App::module(['pc', null, null], ['app_namespace' => 'app', 'app_debug' => true, 'app_trace' => false, ...], null) in App.php line 133
  9. at App::run() in start.php line 18
  10. at require('/alidata1/wwwroot/ww...') in DuihaoJO.php line 25
  11. at require('/alidata1/wwwroot/ww...') in index.php line 23

Exception Datas

Error Context
api index/xiangmu
param { "categoryid": "38", "category": "\u6d4b\u8bd5" }
location [ "data" ]
data []
apiurl http://www.wdunncpa.com/api.php/index/xiangmu?categoryid=38&category=测试
key category
value 测试
file_open_time 1572384217
http_response_header [ "HTTP\/1.1 502 Bad Gateway", "Server: Tengine", "Date: Tue, 29 Oct 2019 21:23:37 GMT", "Content-Type: text\/html", "Content-Length: 96", "Connection: close", "Set-Cookie: acw_tc=2760828215723842171743677eef5ffa8778aed880c345ca7eee4f5787466f;path=\/;HttpOnly;Max-Age=2678401", "Set-Cookie: acw_tc=2760828215723842171743677eef5ffa8778aed880c345ca7eee4f5787466f;path=\/;HttpOnly;Max-Age=2678401", "ETag: \"5dae82cc-60\"" ]

Environment Variables

GET Data
categoryid 38
category 测试
POST Dataempty
Filesempty
Cookies
refer http://www.wdunncpa.com/?categoryid=38&category=%E6%B5%8B%E8%AF%95
Sessionempty
Server/Request Data
TEMP /tmp
TMPDIR /tmp
TMP /tmp
PATH /usr/local/bin:/usr/bin:/bin
USER www
HOME /home/www
FCGI_ROLE RESPONDER
SCRIPT_FILENAME /alidata1/wwwroot/www.wdunncpa.com/index.php
QUERY_STRING s=&categoryid=38&category=%E6%B5%8B%E8%AF%95
REQUEST_METHOD GET
CONTENT_TYPE
CONTENT_LENGTH
SCRIPT_NAME /index.php
REQUEST_URI /?categoryid=38&category=%E6%B5%8B%E8%AF%95
DOCUMENT_URI /index.php
DOCUMENT_ROOT /alidata1/wwwroot/www.wdunncpa.com
SERVER_PROTOCOL HTTP/1.1
REQUEST_SCHEME http
GATEWAY_INTERFACE CGI/1.1
SERVER_SOFTWARE nginx/1.14.0
REMOTE_ADDR 39.96.130.39
REMOTE_PORT 49675
SERVER_ADDR 172.26.115.190
SERVER_PORT 80
SERVER_NAME www.wdunncpa.com
REDIRECT_STATUS 200
HTTP_HOST www.wdunncpa.com
HTTP_USER_AGENT Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0); 360Spider(compatible; HaosouSpider; http://www.haosou.com/help/help_3_2.html)
HTTP_X_TRUE_IP 45.35.226.74
HTTP_X_REAL_IP 45.35.226.74
HTTP_WEB_SERVER_TYPE nginx
HTTP_WL_PROXY_CLIENT_IP 45.35.226.74
HTTP_X_FORWARDED_FOR 45.35.226.74
HTTP_X_FORWARDED_PROTO http
HTTP_X_FORWARDED_CLUSTER waf,
HTTP_EAGLEEYE_TRACEID 2760822715723842168052532e74fc
HTTP_ACCEPT_ENCODING gzip, deflate
HTTP_ACCEPT */*
HTTP_EAGLEEYE_RPCID 0.1
PHP_SELF /index.php
REQUEST_TIME_FLOAT 1572384216.8158
REQUEST_TIME 1572384216
PATH_INFO
Environment Variablesempty
ThinkPHP Constants
BIND_MODULE pc
APP_PATH /alidata1/wwwroot/www.wdunncpa.com/include/../apps/
RUNTIME_PATH /alidata1/wwwroot/www.wdunncpa.com/include/../runtime/
APP_DEBUG true
DUIHAO_ROOT /alidata1/wwwroot/www.wdunncpa.com/
MICROTIME_START 0.81643100 1572384216
IN_DUIHAO true
MAGIC_QUOTES_GPC false
TIME 1572384216
EXT_DIR /alidata1/wwwroot/www.wdunncpa.com/extend/
CACHE_DIR /alidata1/wwwroot/www.wdunncpa.com/runtime/cache/
APP_DIR /alidata1/wwwroot/www.wdunncpa.com/apps/
ADMIN_DIR /alidata1/wwwroot/www.wdunncpa.com/apps/admin/
DB_HOST rm-8vbp93t1q6309y708.mysql.zhangbei.rds.aliyuncs.com
DB_USER bjraxfxx
DB_PW q6309Y708#$%vbp93t1
DB_NAME ronganxiaofang_db
DB_PRE jo3_
DB_CHARSET utf8
DB_PCONNECT 0
DB_DATABASE mysql
COOKIE_PATH /
COOKIE_PRE dSBmnAEGLK
COOKIE_TTL 36000
APIURL http://www.wdunncpa.com/api.php/
THINK_VERSION 5.0.0 RC4
THINK_START_TIME 1572384216.8186
THINK_START_MEM 509512
EXT .php
DS /
THINK_PATH /alidata1/wwwroot/www.wdunncpa.com/framework/
LIB_PATH /alidata1/wwwroot/www.wdunncpa.com/framework/library/
CORE_PATH /alidata1/wwwroot/www.wdunncpa.com/framework/library/think/
TRAIT_PATH /alidata1/wwwroot/www.wdunncpa.com/framework/library/traits/
ROOT_PATH /alidata1/wwwroot/www.wdunncpa.com/include/../
EXTEND_PATH /alidata1/wwwroot/www.wdunncpa.com/include/../extend/
VENDOR_PATH /alidata1/wwwroot/www.wdunncpa.com/include/../vendor/
LOG_PATH /alidata1/wwwroot/www.wdunncpa.com/include/../runtime/log/
CACHE_PATH /alidata1/wwwroot/www.wdunncpa.com/include/../runtime/cache/
TEMP_PATH /alidata1/wwwroot/www.wdunncpa.com/include/../runtime/temp/
CONF_PATH /alidata1/wwwroot/www.wdunncpa.com/include/../apps/
CONF_EXT .php
ENV_PREFIX PHP_
IS_CLI false
IS_WIN false
UPLOAD_ROOT /upload/