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.
  1. if ( ! function_exists('get_config'))
  2. {
  3. function &get_config($replace = array())
  4. {
  5. static $_config;
  6. if (isset($_config))
  7. {
  8. return $_config[0];
  9. }
  10. // Is the config file in the environment folder?
  11. if ( ! defined('ENVIRONMENT') OR ! file_exists($file_path = APPPATH.'config/'.ENVIRONMENT.'/config.php'))
  12. {
  13. $file_path = APPPATH.'config/config.php';
  14. }
  15. // Fetch the config file
  16. if ( ! file_exists($file_path))
  17. {
  18. exit('The configuration file does not exist.');
  19. }
  20. require($file_path);
  21. // Does the $config array exist in the file?
  22. if ( ! isset($config) OR ! is_array($config))
  23. {
  24. exit('Your config file does not appear to be formatted correctly.');
  25. }
  26. // Are any values being dynamically replaced?
  27. if (count($replace) > 0)
  28. {
  29. foreach ($replace as $key => $val)
  30. {
  31. if (isset($config[$key]))
  32. {
  33. $config[$key] = $val;
  34. }
  35. }
  36. }
  37. return $_config[0] =& $config;
  38. }
  39. }
Replace code
  1. if ( ! function_exists('get_config'))
  2. {
  3. function &get_config($replace = array())
  4. {
  5. static $_config;
  6. if (isset($_config))
  7. {
  8. return $_config[0];
  9. }
  10. // Is the config file in the environment folder?
  11. if ( ! defined('ENVIRONMENT') OR ! file_exists($file_path = APPPATH.'config/'.ENVIRONMENT.'/config.php'))
  12. {
  13. $file_path = APPPATH.'config/config.php';
  14. }
  15. // Fetch the config file
  16. if ( ! file_exists($file_path))
  17. {
  18. exit('The configuration file does not exist.');
  19. }
  20. require($file_path);
  21. // Does the $config array exist in the file?
  22. if ( ! isset($config) OR ! is_array($config))
  23. {
  24. exit('Your config file does not appear to be formatted correctly.');
  25. }
  26. // Are any values being dynamically replaced?
  27. if (count($replace) > 0)
  28. {
  29. foreach ($replace as $key => $val)
  30. {
  31. if (isset($config[$key]))
  32. {
  33. $config[$key] = $val;
  34. }
  35. }
  36. }
  37. $_config[0] =& $config;
  38. return $_config[0];
  39. }
  40. }
and refresh page.