[2002] PDOException in Connection.php line 528

SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Name or service not known

  1. try {
  2. if (empty($config['dsn'])) {
  3. $config['dsn'] = $this->parseDsn($config);
  4. }
  5. if ($config['debug']) {
  6. $startTime = microtime(true);
  7. }
  8. $this->links[$linkNum] = new PDO($config['dsn'], $config['username'], $config['password'], $params);
  9. if ($config['debug']) {
  10. // 记录数据库连接信息
  11. $this->log('[ DB ] CONNECT:[ UseTime:' . number_format(microtime(true) - $startTime, 6) . 's ] ' . $config['dsn']);
  12. }
  13. return $this->links[$linkNum];
  14. } catch (\PDOException $e) {
  15. if ($autoConnection) {

Call Stack

  1. in Connection.php line 528
  2. at PDO->__construct() in Connection.php line 528
  3. at Connection->connect() in Connection.php line 2024
  4. at Connection->initConnect() in Connection.php line 644
  5. at Connection->query() in Mysql.php line 90
  6. at Mysql->getFields() in Connection.php line 377
  7. at Connection->getTableInfo() in Connection.php line 454
  8. at Connection->getFieldsBind() in Builder.php line 292
  9. at Builder->buildWhere() in Builder.php line 264
  10. at Builder->parseWhere() in Builder.php line 998
  11. at Builder->select() in Connection.php line 1281
  12. at Connection->value() in Connection.php line 1327
  13. at Connection->aggregate() in Query.php line 643
  14. at Query->aggregate() in Query.php line 678
  15. at Query->count() in Share.php line 24
  16. at Share->app()
  17. at ReflectionMethod->invokeArgs() in Container.php line 395
  18. at Container->invokeReflectMethod() in Module.php line 131
  19. at Module->think\route\dispatch\{closure}()
  20. at call_user_func_array() in Middleware.php line 185
  21. at Middleware->think\{closure}()
  22. at call_user_func() in Middleware.php line 130
  23. at Middleware->dispatch() in Module.php line 136
  24. at Module->exec() in Dispatch.php line 168
  25. at Dispatch->run() in App.php line 432
  26. at App->think\{closure}()
  27. at call_user_func_array() in Middleware.php line 185
  28. at Middleware->think\{closure}() in sys.php line 145
  29. at {closure}()
  30. at call_user_func_array() in Middleware.php line 185
  31. at Middleware->think\{closure}() in common.php line 247
  32. at {closure}()
  33. at call_user_func_array() in Middleware.php line 185
  34. at Middleware->think\{closure}()
  35. at call_user_func() in Middleware.php line 130
  36. at Middleware->dispatch() in App.php line 435
  37. at App->run() in index.php line 25

Environment Variables

GET Data
c mn4en
t Android
POST Dataempty
Filesempty
Cookiesempty
Sessionempty
Server/Request Data
USER www
HOME /home/www
HTTP_HOST app.weiditui1.com
HTTP_USER_AGENT claudebot
HTTP_ACCEPT */*
PATH_INFO
REDIRECT_STATUS 200
SERVER_NAME app.weiditui1.com
SERVER_PORT 80
SERVER_ADDR 172.24.51.154
REMOTE_PORT 54902
REMOTE_ADDR 54.226.126.38
SERVER_SOFTWARE nginx/1.20.2
GATEWAY_INTERFACE CGI/1.1
REQUEST_SCHEME http
SERVER_PROTOCOL HTTP/1.1
DOCUMENT_ROOT /www/wwwroot/app.weiditui1.com/public
DOCUMENT_URI /index.php
REQUEST_URI /qrcode/share/app?c=mn4en&t=Android
SCRIPT_NAME /index.php
CONTENT_LENGTH
CONTENT_TYPE
REQUEST_METHOD GET
QUERY_STRING s=/qrcode/share/app&c=mn4en&t=Android
SCRIPT_FILENAME /www/wwwroot/app.weiditui1.com/public/index.php
FCGI_ROLE RESPONDER
PHP_SELF /index.php
REQUEST_TIME_FLOAT 1711623196.8161
REQUEST_TIME 1711623196
Environment Variablesempty
ThinkPHP Constants
ROOT_PATH /www/wwwroot/app.weiditui1.com/public/
RSA_KEY_PATH /www/wwwroot/app.weiditui1.com/public/../rsa_key/
EXTEND_PATH /www/wwwroot/app.weiditui1.com/public/../extend/
TASK_DATA_PATH /www/wwwroot/app.weiditui1.com/public/../task_data/
FILTER_VALIDATE_BOOL 258
HTMLPURIFIER_PREFIX /www/wwwroot/app.weiditui1.com/vendor/ezyang/htmlpurifier/library
QINIU_FUNCTIONS_VERSION 7.2.10