I tried to run CodeIgniter in my local machin,but I got this error
does anyone know what is the problem? I ma using MAMP on mac
ErrorException [ Fatal Error ]: Unable to connect to your database server using the provided settings. / Filename: core/Loader.php / Line Number: 346 APPPATH/controllers/home.php [ 9 ]
protected $os_platforms = NULL;
function __construct()
{
parent::__construct();
$this->load->model(strtolower(__CLASS__).'_model', 'model');
$this->load->config('brandmgr', TRUE);
$this->lang->load(strtolower(__CLASS__));
$this->_auto_rootCrumb();
FCPATH/system/database/DB_driver.php [ 1197 ] » MY_Exceptions->show_error(arguments)
FCPATH/system/database/DB_driver.php [ 124 ] » CI_DB_driver->display_error(arguments)
FCPATH/system/database/DB.php [ 148 ] » CI_DB_driver->initialize()
FCPATH/system/core/Loader.php [ 346 ] » DB(arguments)
FCPATH/system/core/Loader.php [ 1171 ] » CI_Loader->database()
FCPATH/system/core/Loader.php [ 152 ] » CI_Loader->_ci_autoloader()
FCPATH/system/core/Controller.php [ 51 ] » CI_Loader->initialize()
APPPATH/core/MY_Controller.php [ 25 ] » CI_Controller->__construct()
APPPATH/controllers/home.php [ 9 ] » MY_Controller->__construct()
FCPATH/system/core/CodeIgniter.php [ 308 ] » Home->__construct()
FCPATH/index.php [ 214 ] » require_once(arguments)
Thanks in advanced!
Here is database.php
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
$active_group = ENVIRONMENT;
$active_record = TRUE;
$db['development']['hostname'] = 'localhost';
$db['development']['username'] = 'fake';
$db['development']['password'] = 'fake';
$db['development']['database'] = 'bmgr';
$db['development']['dbdriver'] = 'mysqli';
$db['development']['dbprefix'] = '';
$db['development']['pconnect'] = TRUE;
$db['development']['db_debug'] = TRUE;
$db['development']['cache_on'] = FALSE;
$db['development']['cachedir'] = '';
$db['development']['char_set'] = 'utf8';
$db['development']['dbcollat'] = 'utf8_general_ci';
$db['development']['swap_pre'] = '';
$db['development']['autoinit'] = TRUE;
$db['development']['stricton'] = FALSE;
$db['staging']['hostname'] = 'localhost';
$db['staging']['username'] = 'fake';
$db['staging']['password'] = 'fake';
$db['staging']['database'] = 'bmgr1';
$db['staging']['dbdriver'] = 'mysqli';
$db['staging']['dbprefix'] = '';
$db['staging']['pconnect'] = TRUE;
$db['staging']['db_debug'] = TRUE;
$db['staging']['cache_on'] = FALSE;
$db['staging']['cachedir'] = '';
$db['staging']['char_set'] = 'utf8';
$db['staging']['dbcollat'] = 'utf8_general_ci';
$db['staging']['swap_pre'] = '';
$db['staging']['autoinit'] = TRUE;
$db['staging']['stricton'] = FALSE;
added the enviroment
define('ENVIRONMENT', 'development');
*---------------------------------------------------------------
* ERROR REPORTING
*---------------------------------------------------------------
if (defined('ENVIRONMENT'))
{
switch (ENVIRONMENT)
{
case 'development':
case 'staging':
error_reporting(E_ALL);
ini_set('display_errors', 1);
break;
case 'testing':
case 'production':
error_reporting(0);
ini_set('display_errors', 0);
break;
default:
exit('The application environment is not set correctly.');
}
}