我得到这个错误尝试访问我们的SCADA网站:
A Database Error Occurred
Unable to connect to your database server using the provided settings.
Filename: core/Loader.php
Line Number: 341
我扫描了Loader.php文件,在第341行发现了以下代码:$CI->db =& DB($params, $active_record);
这是包含错误代码的完整块:
public function database($params = '', $return = FALSE, $active_record = NULL)
{
// Grab the super object
$CI =& get_instance();
// Do we even need to load the database class?
if (class_exists('CI_DB') AND $return == FALSE AND $active_record == NULL AND isset($CI->db) AND is_object($CI->db))
{
return FALSE;
}
require_once(BASEPATH.'database/DB.php');
if ($return === TRUE)
{
return DB($params, $active_record);
}
// Initialize the db variable. Needed to prevent
// reference errors with some configurations
$CI->db = '';
// Load the DB class
$CI->db =& DB($params, $active_record);
}
1条答案
按热度按时间zsohkypk1#
您提到的文件正是问题发生时发生呼叫的位置。
真实的的问题是:
1.您在
application/configuration/database.php
或1.您的数据库服务器已关闭、无法访问或凭据已更改