[8] ErrorException in Site.php line 37

未定义数组索引: HTTP_USER_AGENT

  1. protected $showowernum = 20;//非重点用户推荐自己的文章数
  2. //当前媒体信息
  3. protected $mediainfo;
  4. //被带外链媒体
  5. //private $outmedia;
  6. public function _initialize()
  7. {
  8. parent::_initialize();
  9. $useragent = $_SERVER['HTTP_USER_AGENT'];
  10. if(strlen($useragent) <= 50 && empty(isSpider())){
  11. exit;
  12. }
  13. if(strpos(strtolower($useragent),'httpclient')){
  14. exit;
  15. }
  16. if(strpos(strtolower($useragent),'phantomjs')){
  17. exit;
  18. }

Call Stack

  1. in Site.php line 37
  2. at Error::appError(8, 'Undefined index: HTT...', '/www/wwwroot/admin_y...', 37, []) in Site.php line 37
  3. at Site->_initialize() in Controller.php line 56
  4. at Controller->__construct(object(Request))
  5. at ReflectionClass->newInstanceArgs([object(Request)]) in App.php line 215
  6. at App::invokeClass('app\index\controller...') in Loader.php line 420
  7. at Loader::controller('site', 'controller', false, 'Error') in App.php line 386
  8. at App::module(['index', 'site', 'index'], ['app_host' => '', 'app_debug' => true, 'app_trace' => false, ...], false) in App.php line 295
  9. at App::exec(['type' => 'module', 'module' => ['index', 'site', 'index'], 'convert' => false], ['app_host' => '', 'app_debug' => true, 'app_trace' => false, ...]) in App.php line 123
  10. at App::run() in start.php line 18
  11. at require('/www/wwwroot/admin_y...') in index.php line 26

Environment Variables

GET Data
empty
POST Data
empty
Files
empty
Cookies
empty
Session
empty

Server/Request Data

USER
www
HOME
/home/www
HTTP_X_ARR_LOG_ID
bea8141a-bba3-4179-add4-0c548a8f62be
HTTP_X_ORIGINAL_URL
/gongqiu/
HTTP_MAX_FORWARDS
10
HTTP_ACCEPT
*/*
HTTP_CONNECTION
close
HTTP_X_FORWARDED_FOR
122.10.57.90:47961, 124.232.133.96
HTTP_X_REAL_IP
124.232.133.96
HTTP_X_CLIENT_PROTO_VER
HTTP/1.1
HTTP_X_FORWARDED_PROTO
http
HTTP_X_CLIENT_PROTO
http
HTTP_HOST
metalnews.yingshangbao.net
HTTP_X_STGW_TIME
1543073686.637
PATH_INFO
/gongqiu/
REDIRECT_STATUS
200
SERVER_NAME
admin.yingshangbao.net
SERVER_PORT
80
SERVER_ADDR
10.0.1.68
REMOTE_PORT
49688
REMOTE_ADDR
124.232.133.96
SERVER_SOFTWARE
nginx/1.8.1
GATEWAY_INTERFACE
CGI/1.1
SERVER_PROTOCOL
HTTP/1.1
DOCUMENT_ROOT
/www/wwwroot/admin_yingshangbao_net/public_html
DOCUMENT_URI
/index.php
REQUEST_URI
/gongqiu/
SCRIPT_NAME
/index.php
CONTENT_LENGTH
CONTENT_TYPE
REQUEST_METHOD
GET
QUERY_STRING
s=/gongqiu/
SCRIPT_FILENAME
/www/wwwroot/admin_yingshangbao_net/public_html/index.php
FCGI_ROLE
RESPONDER
PHP_SELF
/index.php
REQUEST_TIME_FLOAT
1543073686.651
REQUEST_TIME
1543073686
Environment Variables
empty

ThinkPHP Constants

APP_PATH
/www/wwwroot/admin_yingshangbao_net/public_html/../application/
THINK_VERSION
5.0.10
THINK_START_TIME
1543073686.6511
THINK_START_MEM
360544
EXT
.php
DS
/
THINK_PATH
/www/wwwroot/admin_yingshangbao_net/thinkphp/
LIB_PATH
/www/wwwroot/admin_yingshangbao_net/thinkphp/library/
CORE_PATH
/www/wwwroot/admin_yingshangbao_net/thinkphp/library/think/
TRAIT_PATH
/www/wwwroot/admin_yingshangbao_net/thinkphp/library/traits/
ROOT_PATH
/www/wwwroot/admin_yingshangbao_net/
EXTEND_PATH
/www/wwwroot/admin_yingshangbao_net/extend/
VENDOR_PATH
/www/wwwroot/admin_yingshangbao_net/vendor/
RUNTIME_PATH
/www/wwwroot/admin_yingshangbao_net/runtime/
LOG_PATH
/www/wwwroot/admin_yingshangbao_net/runtime/log/
CACHE_PATH
/www/wwwroot/admin_yingshangbao_net/runtime/cache/
TEMP_PATH
/www/wwwroot/admin_yingshangbao_net/runtime/temp/
CONF_PATH
/www/wwwroot/admin_yingshangbao_net/public_html/../application/
CONF_EXT
.php
ENV_PREFIX
PHP_
IS_CLI
false
IS_WIN
false
,