When we install codeigniter framework then show error message after installation, how to solved above error in codeigniter framework below step.
Step 1
File Path: root\system\core\Common.php
open Common.php file and find get_config function into file.
- if ( ! function_exists('get_config'))
- {
- function &get_config($replace = array())
- {
- static $_config;
-
- if (isset($_config))
- {
- return $_config[0];
- }
-
-
- if ( ! defined('ENVIRONMENT') OR ! file_exists($file_path = APPPATH.'config/'.ENVIRONMENT.'/config.php'))
- {
- $file_path = APPPATH.'config/config.php';
- }
-
-
- if ( ! file_exists($file_path))
- {
- exit('The configuration file does not exist.');
- }
-
- require($file_path);
-
-
- if ( ! isset($config) OR ! is_array($config))
- {
- exit('Your config file does not appear to be formatted correctly.');
- }
-
-
- if (count($replace) > 0)
- {
- foreach ($replace as $key => $val)
- {
- if (isset($config[$key]))
- {
- $config[$key] = $val;
- }
- }
- }
-
- return $_config[0] =& $config;
- }
- }
Replace code
- if ( ! function_exists('get_config'))
- {
- function &get_config($replace = array())
- {
- static $_config;
-
- if (isset($_config))
- {
- return $_config[0];
- }
-
-
- if ( ! defined('ENVIRONMENT') OR ! file_exists($file_path = APPPATH.'config/'.ENVIRONMENT.'/config.php'))
- {
- $file_path = APPPATH.'config/config.php';
- }
-
-
- if ( ! file_exists($file_path))
- {
- exit('The configuration file does not exist.');
- }
-
- require($file_path);
-
-
- if ( ! isset($config) OR ! is_array($config))
- {
- exit('Your config file does not appear to be formatted correctly.');
- }
-
-
- if (count($replace) > 0)
- {
- foreach ($replace as $key => $val)
- {
- if (isset($config[$key]))
- {
- $config[$key] = $val;
- }
- }
- }
-
- $_config[0] =& $config;
- return $_config[0];
- }
- }
and refresh page.