2

I'm working with CodeIgniter and when I try to connect to a PostgreSQL database with

$this->load->database();

it show me a blank page. In the Apache log, I see the following error:

PHP Fatal error: Class 'CI_DB_postgre_driver' not found in system/database/DB.php on line 144

autoload line: $autoload['libraries'] = array('database');

Here's my database.php:

$active_group = 'default'; $active_record = TRUE;

$db['default']['hostname'] = 'localhost';
$db['default']['username'] = 'user';
$db['default']['password'] = 'user';
$db['default']['database'] = 'database';
$db['default']['dbdriver'] = 'postgre';
$db['default']['dbprefix'] = '';
$db['default']['pconnect'] = TRUE;
$db['default']['db_debug'] = TRUE;
$db['default']['cache_on'] = FALSE;
$db['default']['cachedir'] = '';
$db['default']['char_set'] = 'utf8';
$db['default']['dbcollat'] = 'utf8_general_ci';
$db['default']['swap_pre'] = '';
$db['default']['autoinit'] = TRUE;
$db['default']['stricton'] = FALSE;
10
  • 1
    Do you have a proper configuration for your DB? Commented May 2, 2014 at 15:47
  • 1
    What version of CodeIgniter are you using? Commented May 2, 2014 at 15:51
  • Yes, i checked my configuration and the version of CodeIgniter is 2.1.4 Commented May 2, 2014 at 16:04
  • did you load database in autoload.php Commented May 2, 2014 at 17:09
  • 1
    Does system/database/drivers/postgre/postgre_driver.php exist? (EDIT: Wait, if it didn't, it would fail on line 140. Did you rename the class?) Commented May 2, 2014 at 18:26

1 Answer 1

0

Check if you don't have eval() function disabled:

var_dump(ini_get('disable_functions'));
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.