[2002] PDOException in Connection.php line 300

SQLSTATE[HY000] [2002] No such file or directory

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

Call Stack

  1. in Connection.php line 300
  2. at PDO->__construct('mysql:dbname=tpshop;...', 'root', '123654', [0, 2, 0, ...]) in Connection.php line 300
  3. at Connection->connect() in Connection.php line 941
  4. at Connection->initConnect(false) in Mysql.php line 54
  5. at Mysql->getFields('tp_ad_position') in Query.php line 1722
  6. at Query->getTableInfo('tp_ad_position', 'type') in Query.php line 1770
  7. at Query->getFieldsType(['cache' => ['key' => true, 'expire' => 1, 'tag' => null], 'table' => 'tp_ad_position', 'field' => ['position_id', 'position_name', 'ad_width', ...], ...]) in Query.php line 1776
  8. at Query->getFieldsBind(['cache' => ['key' => true, 'expire' => 1, 'tag' => null], 'table' => 'tp_ad_position', 'field' => ['position_id', 'position_name', 'ad_width', ...], ...]) in Builder.php line 245
  9. at Builder->buildWhere([], ['cache' => ['key' => true, 'expire' => 1, 'tag' => null], 'table' => 'tp_ad_position', 'field' => ['position_id', 'position_name', 'ad_width', ...], ...]) in Builder.php line 223
  10. at Builder->parseWhere([], ['cache' => ['key' => true, 'expire' => 1, 'tag' => null], 'table' => 'tp_ad_position', 'field' => ['position_id', 'position_name', 'ad_width', ...], ...]) in Builder.php line 658
  11. at Builder->select(['cache' => ['key' => true, 'expire' => 1, 'tag' => null], 'table' => 'tp_ad_position', 'field' => ['position_id', 'position_name', 'ad_width', ...], ...]) in Query.php line 2238
  12. at Query->getPdo() in Query.php line 457
  13. at Query->column('position_id,position...', 'position_id') in 8e776332292216d3b099740778053159.php line 28
  14. at include('/var/www/html/runtim...') in File.php line 50
  15. at File->read('/var/www/html/runtim...', ['action' => 'login', 'template_now_time' => 1711614230, 'goods_category_tree' => [['id' => 1, 'name' => '数码、 手机', 'mobile_name' => '数码、 手机', ...], ['id' => 3, 'name' => '电脑', 'mobile_name' => '电脑', ...]], ...]) in Template.php line 196
  16. at Template->fetch('./template/pc/rainbo...', ['action' => 'login', 'template_now_time' => 1711614230, 'goods_category_tree' => [['id' => 1, 'name' => '数码、 手机', 'mobile_name' => '数码、 手机', ...], ['id' => 3, 'name' => '电脑', 'mobile_name' => '电脑', ...]], ...], []) in Think.php line 89
  17. at Think->fetch('', ['action' => 'login', 'template_now_time' => 1711614230, 'goods_category_tree' => [['id' => 1, 'name' => '数码、 手机', 'mobile_name' => '数码、 手机', ...], ['id' => 3, 'name' => '电脑', 'mobile_name' => '电脑', ...]], ...], []) in View.php line 159
  18. at View->fetch('', [], [], []) in Controller.php line 129
  19. at Controller->fetch() in User.php line 123
  20. at User->login()
  21. at ReflectionMethod->invokeArgs(object(User), []) in App.php line 227
  22. at App::invokeMethod([object(User), 'login'], []) in App.php line 405
  23. at App::module(['Home', 'User', 'login'], ['app_namespace' => 'app', 'app_debug' => true, 'app_trace' => false, ...], null) in App.php line 133
  24. at App::run() in start.php line 18
  25. at require('/var/www/html/thinkp...') in index.php line 44

Environment Variables

GET Data
empty
POST Data
empty
Files
empty

Cookies

is_mobile
0
Session
empty

Server/Request Data

REDIRECT_PATH_INFO
Home/User/login.html
REDIRECT_STATUS
200
HTTP_ACCEPT
*/*
HTTP_USER_AGENT
claudebot
HTTP_REFERER
http://721ka.com/Home/User/goods_collect.html
HTTP_HOST
721ka.com
PATH
/sbin:/usr/sbin:/bin:/usr/bin
SERVER_SIGNATURE
SERVER_SOFTWARE
Apache/2.4.52 (Amazon) PHP/5.4.45
SERVER_NAME
721ka.com
SERVER_ADDR
172.31.15.155
SERVER_PORT
80
REMOTE_ADDR
34.204.177.148
DOCUMENT_ROOT
/var/www/html
REQUEST_SCHEME
http
CONTEXT_PREFIX
CONTEXT_DOCUMENT_ROOT
/var/www/html
SERVER_ADMIN
root@localhost
SCRIPT_FILENAME
/var/www/html/index.php
REMOTE_PORT
40778
REDIRECT_URL
/Home/User/login.html
GATEWAY_INTERFACE
CGI/1.1
SERVER_PROTOCOL
HTTP/1.1
REQUEST_METHOD
GET
QUERY_STRING
REQUEST_URI
/Home/User/login.html
SCRIPT_NAME
/index.php
PHP_SELF
/index.php
REQUEST_TIME_FLOAT
1711614230.195
REQUEST_TIME
1711614230
PATH_INFO
Home/User/login.html
Environment Variables
empty

ThinkPHP Constants

PLUGIN_PATH
/var/www/html/plugins/
UPLOAD_PATH
public/upload/
TPSHOP_CACHE_TIME
1
SITE_URL
http://721ka.com
INSTALL_DATE
1463741583
SERIALNUMBER
20160520065303oCWIoa
APP_PATH
/var/www/html/application/
NOW_TIME
1711614230
THINK_VERSION
5.0.7
THINK_START_TIME
1711614230.1966
THINK_START_MEM
268632
EXT
.php
DS
/
THINK_PATH
/var/www/html/thinkphp/
LIB_PATH
/var/www/html/thinkphp/library/
CORE_PATH
/var/www/html/thinkphp/library/think/
TRAIT_PATH
/var/www/html/thinkphp/library/traits/
ROOT_PATH
/var/www/html/
EXTEND_PATH
/var/www/html/extend/
VENDOR_PATH
/var/www/html/vendor/
RUNTIME_PATH
/var/www/html/runtime/
LOG_PATH
/var/www/html/runtime/log/
CACHE_PATH
/var/www/html/runtime/cache/
TEMP_PATH
/var/www/html/runtime/temp/
CONF_PATH
/var/www/html/application/
CONF_EXT
.php
ENV_PREFIX
PHP_
IS_CLI
false
IS_WIN
false
IS_AJAX
false
IS_GET
true
IS_POST
false
MODULE_NAME
home
CONTROLLER_NAME
User
ACTION_NAME
login
PREFIX
tp_
SESSION_ID
b81ea5f8g9dqu2v8b5kf318ji6