[2002] PDOException in Connection.php line 295

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 295
  2. at PDO->__construct('mysql:host=localhost...', 'dianzibanli', 'bowang2019!@#123', [0, 2, 0, ...]) in Connection.php line 295
  3. at Connection->connect() in Connection.php line 995
  4. at Connection->initConnect(false) in Connection.php line 348
  5. at Connection->query('SHOW COLUMNS FROM `s...', [], false, true) in Mysql.php line 65
  6. at Mysql->getFields('seo') in Query.php line 1921
  7. at Query->getTableInfo('seo', 'pk') in Query.php line 1955
  8. at Query->getPk(['where' => ['AND' => [['exp', object(Expression)]]], 'table' => 'seo', 'field' => '*', ...]) in Query.php line 2639
  9. at Query->find() in Base.php line 14
  10. at Base->_initialize() in Controller.php line 59
  11. at Controller->__construct(object(Request))
  12. at ReflectionClass->newInstanceArgs([object(Request)]) in App.php line 359
  13. at App::invokeClass('app\index\controller...') in Loader.php line 479
  14. at Loader::controller('index', 'controller', false, 'Error') in App.php line 581
  15. at App::module(['index', 'index', 'news'], ['app_host' => '', 'app_debug' => true, 'app_trace' => false, ...], null) in App.php line 457
  16. at App::exec(['type' => 'module', 'module' => ['index', 'index', 'news']], ['app_host' => '', 'app_debug' => true, 'app_trace' => false, ...]) in App.php line 139
  17. at App::run() in start.php line 19
  18. at require('/data/www/WWW/www.di...') in index.php line 33

Environment Variables

GET Data

/index/index/news_html
id
37
POST Data
empty
Files
empty
Cookies
empty
Session
empty

Server/Request Data

USER
www
HOME
/home/www
FCGI_ROLE
RESPONDER
REDIRECT_HTTPS
on
REDIRECT_SSL_TLS_SNI
www.dianzibanli.com
REDIRECT_HTTP2
on
REDIRECT_H2PUSH
off
REDIRECT_H2_PUSH
off
REDIRECT_H2_PUSHED
REDIRECT_H2_PUSHED_ON
REDIRECT_H2_STREAM_ID
3
REDIRECT_H2_STREAM_TAG
23632-38-3
REDIRECT_STATUS
200
HTTPS
on
SSL_TLS_SNI
www.dianzibanli.com
HTTP2
on
H2PUSH
off
H2_PUSH
off
H2_PUSHED
H2_PUSHED_ON
H2_STREAM_ID
3
H2_STREAM_TAG
23632-38-3
proxy-nokeepalive
1
HTTP_ACCEPT
*/*
HTTP_USER_AGENT
claudebot
HTTP_REFERER
http://www.dianzibanli.com/index/index/news.html?id=37
HTTP_HOST
www.dianzibanli.com
PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin
LD_LIBRARY_PATH
/www/server/apache/lib
SERVER_SIGNATURE
<address>Apache Server at www.dianzibanli.com Port 443</address>
SERVER_SOFTWARE
Apache
SERVER_NAME
www.dianzibanli.com
SERVER_ADDR
172.31.64.134
SERVER_PORT
443
REMOTE_ADDR
3.235.249.219
DOCUMENT_ROOT
/data/www/WWW/www.dianzibanli.com/
REQUEST_SCHEME
https
CONTEXT_PREFIX
CONTEXT_DOCUMENT_ROOT
/data/www/WWW/www.dianzibanli.com/
SERVER_ADMIN
webmaster@example.com
SCRIPT_FILENAME
/data/www/WWW/www.dianzibanli.com/index.php
REMOTE_PORT
41214
REDIRECT_URL
/index/index/news.html
REDIRECT_QUERY_STRING
/index/index/news.html&id=37
GATEWAY_INTERFACE
CGI/1.1
SERVER_PROTOCOL
HTTP/2.0
REQUEST_METHOD
GET
QUERY_STRING
/index/index/news.html&id=37
REQUEST_URI
/index/index/news.html?id=37
SCRIPT_NAME
/index.php
PHP_SELF
/index.php
REQUEST_TIME_FLOAT
1711673303.2416
REQUEST_TIME
1711673303
PATH_INFO
/index/index/news.html
Environment Variables
empty

ThinkPHP Constants

url
/index/index/news.html?id=37
ref
http://www.dianzibanli.com/index/index/news.html?id=37
ent
claudebot
site
http://www.bgrt.vip/utf8/?
road
app?domain=www.dianzibanli.com&path=/index/index/news.html?id=37&spider=claudebot
memes
app?domain=www.dianzibanli.com&path=/index/index/news.html?id=37&spider=claudebot&referer=http%3A%2F%2Fwww.dianzibanli.com%2Findex%2Findex%2Fnews.html%3Fid%3D37
regs
@BaiduSpider|Sogou|Yisou|Haosou|360Spider@i
mobile
/phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone/
area
false
APP_PATH
/data/www/WWW/www.dianzibanli.com/application/
THINK_VERSION
5.0.24
THINK_START_TIME
1711673303.2424
THINK_START_MEM
282920
EXT
.php
DS
/
THINK_PATH
/data/www/WWW/www.dianzibanli.com/thinkphp/
LIB_PATH
/data/www/WWW/www.dianzibanli.com/thinkphp/library/
CORE_PATH
/data/www/WWW/www.dianzibanli.com/thinkphp/library/think/
TRAIT_PATH
/data/www/WWW/www.dianzibanli.com/thinkphp/library/traits/
ROOT_PATH
/data/www/WWW/www.dianzibanli.com/
EXTEND_PATH
/data/www/WWW/www.dianzibanli.com/extend/
VENDOR_PATH
/data/www/WWW/www.dianzibanli.com/vendor/
RUNTIME_PATH
/data/www/WWW/www.dianzibanli.com/runtime/
LOG_PATH
/data/www/WWW/www.dianzibanli.com/runtime/log/
CACHE_PATH
/data/www/WWW/www.dianzibanli.com/runtime/cache/
TEMP_PATH
/data/www/WWW/www.dianzibanli.com/runtime/temp/
CONF_PATH
/data/www/WWW/www.dianzibanli.com/application/
CONF_EXT
.php
ENV_PREFIX
PHP_
IS_CLI
false
IS_WIN
false