[2] ErrorException in Connection.php line 662

PDO::prepare(): MySQL server has gone away

  1. $this->bind = $bind;
  2. Db::$queryTimes++;
  3. try {
  4. // 调试开始
  5. $this->debug(true);
  6. // 预处理
  7. $this->PDOStatement = $this->linkID->prepare($sql);
  8. // 是否为存储过程调用
  9. $procedure = in_array(strtolower(substr(trim($sql), 0, 4)), ['call', 'exec']);
  10. // 参数绑定
  11. if ($procedure) {
  12. $this->bindParam($bind);
  13. } else {
  14. $this->bindValue($bind);

Call Stack

  1. in Connection.php line 662
  2. at Error::appError(2, 'PDO::prepare(): MySQ...', '/www/wwwroot/www.yh5...', 662, ['sql' => 'SELECT * FROM `yh_ta...', 'bind' => ['ThinkBind_1_' => ['邦邦', 2], 'ThinkBind_2_' => [1, 1], 'ThinkBind_3_' => [3, 1]], 'master' => false, ...])
  3. at PDO->prepare('SELECT * FROM `yh_ta...') in Connection.php line 662
  4. at Connection->query('SELECT * FROM `yh_ta...', ['ThinkBind_1_' => ['邦邦', 2], 'ThinkBind_2_' => [1, 1], 'ThinkBind_3_' => [3, 1]], false, false) in Connection.php line 844
  5. at Connection->find(object(Query)) in Query.php line 3130
  6. at Query->find() in HotWordToRecommend.php line 18
  7. at HotWordToRecommend->app\api1\controller\{closure}()
  8. at call_user_func_array(object(Closure), []) in Container.php line 347
  9. at Container->invokeFunction(object(Closure)) in Driver.php line 185
  10. at Driver->remember('hotwordtorecommend_g...', object(Closure))
  11. at call_user_func_array([object(Redis), 'remember'], ['hotwordtorecommend_g...', object(Closure)]) in Cache.php line 130
  12. at Cache->__call('remember', ['hotwordtorecommend_g...', object(Closure)])
  13. at call_user_func_array([object(Cache), 'remember'], ['hotwordtorecommend_g...', object(Closure)]) in Facade.php line 123
  14. at Facade::__callStatic('remember', ['hotwordtorecommend_g...', object(Closure)]) in HotWordToRecommend.php line 41
  15. at HotWordToRecommend->getListInfo(['媒体', '邦邦', '老百姓', ...], 5) in Topic.php line 98
  16. at Topic->content(object(Request))
  17. at ReflectionMethod->invokeArgs(object(Topic), [object(Request)]) in Container.php line 395
  18. at Container->invokeReflectMethod(object(Topic), object(ReflectionMethod), ['id' => '11480', 'convert' => false]) in Module.php line 132
  19. at Module->think\route\dispatch\{closure}(object(Request), object(Closure), null)
  20. at call_user_func_array(object(Closure), [object(Request), object(Closure), null]) in Middleware.php line 185
  21. at Middleware->think\{closure}(object(Request))
  22. at call_user_func(object(Closure), object(Request)) in Middleware.php line 130
  23. at Middleware->dispatch(object(Request), 'controller') in Module.php line 137
  24. at Module->exec() in Dispatch.php line 168
  25. at Dispatch->run() in App.php line 432
  26. at App->think\{closure}(object(Request), object(Closure), null)
  27. at call_user_func_array(object(Closure), [object(Request), object(Closure), null]) in Middleware.php line 185
  28. at Middleware->think\{closure}(object(Request))
  29. at call_user_func(object(Closure), object(Request)) in Middleware.php line 130
  30. at Middleware->dispatch(object(Request)) in App.php line 435
  31. at App->run() in index.php line 21

Environment Variables

GET Dataempty
POST Dataempty
Filesempty
Cookies
gw_11480_0 1
Sessionempty
Server/Request Data
USER www
HOME /home/www
HTTP_HOST yhcko.com
HTTP_USER_AGENT claudebot
HTTP_ACCEPT */*
PATH_INFO
REDIRECT_STATUS 200
SERVER_NAME www.yh596.com
SERVER_PORT 80
SERVER_ADDR 172.26.193.191
REMOTE_PORT 46020
REMOTE_ADDR 34.205.2.207
SERVER_SOFTWARE nginx/1.19.0
GATEWAY_INTERFACE CGI/1.1
REQUEST_SCHEME http
SERVER_PROTOCOL HTTP/1.1
DOCUMENT_ROOT /www/wwwroot/www.yh596.com/public
DOCUMENT_URI /index.php
REQUEST_URI /index/article/11480
SCRIPT_NAME /index.php
CONTENT_LENGTH
CONTENT_TYPE
REQUEST_METHOD GET
QUERY_STRING s=/index/article/11480
SCRIPT_FILENAME /www/wwwroot/www.yh596.com/public/index.php
FCGI_ROLE RESPONDER
PHP_SELF /index.php
REQUEST_TIME_FLOAT 1711698219.9699
REQUEST_TIME 1711698219
Environment Variablesempty
ThinkPHP Constantsempty