setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); } catch (PDOException $e) { die("数据库连接失败: " . $e->getMessage()); } // Redis 配置(不使用密码) $REDIS_ENABLED = false; $redis = null; if (extension_loaded('redis')) { try { $redis = new Redis(); if (@$redis->connect('localhost', 6379)) { // 暂时注释掉密码认证 // $redis->auth('19841122Cy!'); $REDIS_ENABLED = true; } } catch (Exception $e) { error_log("Redis连接失败: " . $e->getMessage()); } } ?>