系统发生错误

[2] ErrorException in common.php line 2417

file_get_contents(http://ip.taobao.com/outGetIpInfo?ip=216.73.216.123&accessKey=alibaba-inc): failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found

  1. // 若未指定 IP,获取客户端真实 IP
  2. if (empty($ip)) {
  3. $ip = getClientRealIp();
  4. }
  5. // 接口请求地址
  6. $url = "http://ip.taobao.com/outGetIpInfo?ip={$ip}&accessKey=alibaba-inc";
  7. // 发送 HTTP 请求(使用 curl 或 file_get_contents)
  8. $response = file_get_contents($url);
  9. if (!$response) {
  10. return false;
  11. }
  12. // 解析 JSON 结果
  13. $result = json_decode($response, true);
  14. // 检查返回状态(code=0 表示成功)
  15. if ($result['code'] != 0) {

Call Stack

  1. in common.php line 2417
  2. at Error::appError(2, 'file_get_contents(ht...', '/www/wwwroot/oxhorn/...', 2417, ['ip' => '216.73.216.123', 'url' => 'http://ip.taobao.com...', 'http_response_header' => ['HTTP/1.1 301 Moved P...', 'Server: Tengine/ASer...', 'Date: Sun, 08 Mar 20...', ...]])
  3. at file_get_contents('http://ip.taobao.com...') in common.php line 2417
  4. at getIpLocationByTaobao('216.73.216.123') in Common.php line 39
  5. at Common->__construct()
  6. at ReflectionClass->newInstanceArgs([]) in Container.php line 439
  7. at Container->invokeClass('app\index\controller...', []) in Container.php line 284
  8. at Container->make('app\index\controller...', []) in App.php line 725
  9. at App->controller('index', 'controller', false, 'Error') in Module.php line 95
  10. at Module->exec() in Dispatch.php line 168
  11. at Dispatch->run() in App.php line 432
  12. at App->think\{closure}(object(Request), object(Closure), null)
  13. at call_user_func_array(object(Closure), [object(Request), object(Closure), null]) in Middleware.php line 185
  14. at Middleware->think\{closure}(object(Request))
  15. at call_user_func(object(Closure), object(Request)) in Middleware.php line 130
  16. at Middleware->dispatch(object(Request)) in App.php line 435
  17. at App->run() in index.php line 15

Environment Variables

GET Dataempty
POST Dataempty
Filesempty
Cookiesempty
Sessionempty
Server/Request Data
USER www
HOME /home/www
HTTP_ACCEPT_ENCODING gzip, br, zstd, deflate
HTTP_USER_AGENT Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
HTTP_ACCEPT */*
PATH_INFO
HTTP_HOST www.niujiaojian.com
REDIRECT_STATUS 200
SERVER_NAME www.niujiaojian.com
SERVER_PORT 443
SERVER_ADDR 172.16.61.177
REMOTE_PORT 46566
REMOTE_ADDR 216.73.216.123
SERVER_SOFTWARE nginx/1.28.0
GATEWAY_INTERFACE CGI/1.1
HTTPS on
REQUEST_SCHEME https
SERVER_PROTOCOL HTTP/2.0
DOCUMENT_ROOT /www/wwwroot/oxhorn/public
DOCUMENT_URI /index.php
REQUEST_URI /sitemap.xml
SCRIPT_NAME /index.php
CONTENT_LENGTH
CONTENT_TYPE
REQUEST_METHOD GET
QUERY_STRING s=/sitemap.xml
SCRIPT_FILENAME /www/wwwroot/oxhorn/public/index.php
FCGI_ROLE RESPONDER
PHP_SELF /index.php
REQUEST_TIME_FLOAT 1772951525.4565
REQUEST_TIME 1772951525
Environment Variablesempty
ThinkPHP Constants
DS /
ROOT_PATH /www/wwwroot/oxhorn/public/
ROOT /www/wwwroot/oxhorn/
__MY_HTTP__ https
__MY_ROOT__
__MY_ROOT_PUBLIC__ /
__MY_HOST__ www.niujiaojian.com
__MY_PUBLIC_URL__ https://www.niujiaojian.com/

[1] ErrorException in think_exception.tpl line 417

Uncaught think\exception\ErrorException: Use of undefined constant APPLICATION_VERSION - assumed 'APPLICATION_VERSION' (this will throw an Error in a future version of PHP) in /www/wwwroot/oxhorn/thinkphp/tpl/think_exception.tpl:417
Stack trace:
#0 /www/wwwroot/oxhorn/thinkphp/tpl/think_exception.tpl(417): think\Error::appError(2, 'Use of undefine...', '/www/wwwroot/ox...', 417, Array)
#1 /www/wwwroot/oxhorn/thinkphp/library/think/exception/Handle.php(184): include('/www/wwwroot/ox...')
#2 /www/wwwroot/oxhorn/thinkphp/library/think/exception/Handle.php(97): think\exception\Handle->convertExceptionToResponse(Object(think\exception\ErrorException))
#3 /www/wwwroot/oxhorn/thinkphp/library/think/Error.php(56): think\exception\Handle->render(Object(think\exception\ErrorException))
#4 [internal function]: think\Error::appException(Object(think\exception\ErrorException))
#5 {main}
thrown

  1. </tbody>
  2. <?php } ?>
  3. </table>
  4. <?php } ?>
  5. </div>
  6. <?php } ?>
  7. <div class="copyright">
  8. <a title="" href="" target="_blank"></a>
  9. <span><?php echo APPLICATION_VERSION; ?></span>
  10. <a title="" href="" target="_blank" class="bbs-ask"></a>
  11. <span></span>
  12. </div>
  13. <?php if(\think\facade\App::isDebug()) { ?>
  14. <script>
  15. var LINE = <?php echo $line; ?>;
  16. function $(selector, node){
  17. var elements;

Call Stack

  1. in think_exception.tpl line 417
  2. at Error::appShutdown()

Environment Variables

GET Dataempty
POST Dataempty
Filesempty
Cookiesempty
Sessionempty
Server/Request Data
USER www
HOME /home/www
HTTP_ACCEPT_ENCODING gzip, br, zstd, deflate
HTTP_USER_AGENT Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
HTTP_ACCEPT */*
PATH_INFO
HTTP_HOST www.niujiaojian.com
REDIRECT_STATUS 200
SERVER_NAME www.niujiaojian.com
SERVER_PORT 443
SERVER_ADDR 172.16.61.177
REMOTE_PORT 46566
REMOTE_ADDR 216.73.216.123
SERVER_SOFTWARE nginx/1.28.0
GATEWAY_INTERFACE CGI/1.1
HTTPS on
REQUEST_SCHEME https
SERVER_PROTOCOL HTTP/2.0
DOCUMENT_ROOT /www/wwwroot/oxhorn/public
DOCUMENT_URI /index.php
REQUEST_URI /sitemap.xml
SCRIPT_NAME /index.php
CONTENT_LENGTH
CONTENT_TYPE
REQUEST_METHOD GET
QUERY_STRING s=/sitemap.xml
SCRIPT_FILENAME /www/wwwroot/oxhorn/public/index.php
FCGI_ROLE RESPONDER
PHP_SELF /index.php
REQUEST_TIME_FLOAT 1772951525.4565
REQUEST_TIME 1772951525
Environment Variablesempty
ThinkPHP Constants
DS /
ROOT_PATH /www/wwwroot/oxhorn/public/
ROOT /www/wwwroot/oxhorn/
__MY_HTTP__ https
__MY_ROOT__
__MY_ROOT_PUBLIC__ /
__MY_HOST__ www.niujiaojian.com
__MY_PUBLIC_URL__ https://www.niujiaojian.com/