Database Err: SQLSTATE[HY000] [2002] Connection refused
- /www/wwwroot/test.com/protected/lib/speed.php on line 358
353.
try {
354.
if(!class_exists("PDO") || !in_array("mysql",PDO::getAvailableDrivers(), true)){
355.
err('Database Err: PDO or PDO_MYSQL doesn\'t exist!');
356.
}
357.
$GLOBALS['mysql_instances'][$db_config_key] = new PDO('mysql:dbname='.$db_config['MYSQL_DB'].';host='.$db_config['MYSQL_HOST'].';port='.$db_config['MYSQL_PORT'], $db_config['MYSQL_USER'], $db_config['MYSQL_PASS'], array(PDO::MYSQL_ATTR_INIT_COMMAND=>'SET NAMES \''.$db_config['MYSQL_CHARSET'].'\''));
358.
359.
}catch(PDOException $e){err('Database Err: '.$e->getMessage());}
}
360.
return $GLOBALS['mysql_instances'][$db_config_key];
361.
}
362.
363.
private function _where($conditions){
- /www/wwwroot/test.com/protected/lib/speed.php on line 328
323.
324.
if($readonly && !empty($GLOBALS['mysql']['MYSQL_SLAVE'])){
325.
$slave_key = array_rand($GLOBALS['mysql']['MYSQL_SLAVE']);
326.
$sth = $this->dbInstance($GLOBALS['mysql']['MYSQL_SLAVE'][$slave_key], 'slave_'.$slave_key)->prepare($sql);
327.
}else{
328.
329.
$sth = $this->dbInstance($GLOBALS['mysql'], 'master')->prepare($sql);
}
330.
331.
if(is_array($params) && !empty($params)){
332.
foreach($params as $k => &$v){
333.
if(is_int($v)){
- /www/wwwroot/test.com/protected/lib/speed.php on line 320
315.
}
316.
}
317.
return $this->page;
318.
}
319.
320.
321.
public function query($sql, $params = array()){return $this->execute($sql, $params, true);}
public function execute($sql, $params = array(), $readonly = false){
322.
$this->sql[] = $sql;
323.
324.
if($readonly && !empty($GLOBALS['mysql']['MYSQL_SLAVE'])){
325.
$slave_key = array_rand($GLOBALS['mysql']['MYSQL_SLAVE']);
- /www/wwwroot/test.com/protected/lib/speed.php on line 240
235.
$limit = $this->pager($limit[0], $limit[1], $limit[2], $total[0]['M_COUNTER']);
236.
$limit = empty($limit) ? '' : ' LIMIT '.$limit['offset'].','.$limit['limit'];
237.
}else{
238.
$limit = !empty($limit) ? ' LIMIT '.$limit : '';
239.
}
240.
241.
return $this->query('SELECT '. $fields . $sql . $sort . $limit, $conditions["_bindParams"]);
}
242.
243.
public function find($conditions = array(), $sort = null, $fields = '*'){
244.
$res = $this->findAll($conditions, $sort, $fields, 1);
245.
return !empty($res) ? array_pop($res) : false;
- /www/wwwroot/test.com/protected/controller/pc/BaseController.php on line 93
88.
/**
89.
* 获取友情链接
90.
*/
91.
public function getLinks(){
92.
$links = new ZdLinks();
93.
94.
$this->links_txt = $links->findAll(array("linkstatus"=>1,"type"=>1));
$this->links_img = $links->findAll(array("linkstatus"=>1,"type"=>2));
95.
}
96.
}
- /www/wwwroot/test.com/protected/controller/pc/BaseController.php on line 24
19.
"site_keywords"=>"不死鸟空间,群推网,免费推广,软文推广,微信群推广,大模型推广,智能体推广,公众号推广,微信推广,微信群二维码,微信红包群,微信群发布,微信号推广,群推,智能体商店,小程序商店,AI工具集,Chat聊天,AI绘图,AI视频,AI音乐,AI角色",
20.
"site_description"=>"想要提升品牌影响力?选择群推网,我们提供专业的推广服务,帮助您扩大品牌曝光,增加用户粘性。免费推广,免费收录!!",
21.
"site_generator"=>"Powered by 群推网",
22.
"site_author"=>"不死鸟空间-群推网-提升品牌影响力",
23.
);
24.
25.
$this->getLinks();
$this->checkToken();
26.
$this->unread = 0;
27.
$datetime = new DateTime('now', new DateTimeZone('Europe/Paris'));
28.
$this->pt = $datetime->format('c');
29.
$this->_now_time = time();
- /www/wwwroot/test.com/protected/controller/pc/MainController.php on line 8
3.
include 'protected/include/phpqrcode/phpqrcode.php';
4.
use \Firebase\JWT\JWT;
5.
use Firebase\JWT\Key;
6.
class MainController extends BaseController {
7.
function __construct(){
8.
9.
parent::__construct();
10.
11.
}
12.
// 广告数据详情
13.
function actionaddetails(){
- /www/wwwroot/test.com/protected/lib/speed.php on line 95
90.
header("Location:".$url);
91.
exit;
92.
};
93.
if(!method_exists($controller_name, $action_name))_err_router("Err: Method '$action_name' of '$controller_name' is not exists!");
94.
95.
96.
$controller_obj = new $controller_name();
$controller_obj->$action_name();
97.
98.
if($controller_obj->_auto_display){
99.
$auto_tpl_name = (empty($__module) ? '' : $__module.DS).$__controller.'_'.$__action.'.html';
100.
if(file_exists(APP_DIR.DS.'protected'.DS.'view'.DS.$auto_tpl_name))$controller_obj->display($auto_tpl_name);
- /www/wwwroot/test.com/index.php on line 8
3.
header('Access-Control-Allow-Origin: *');
4.
header('Access-Control-Allow-Methods: GET, POST, OPTIONS');
5.
header('Access-Control-Allow-Headers: Content-Type, Authorization, X-Requested-With');
6.
define('APP_DIR', realpath('./'));
7.
define("APP_PATH",dirname(__FILE__));
8.
require(APP_DIR.'/protected/lib/speed.php');