0

I'm developing a PHP application using CodeIgniter as the framework, and PostgreSQL as the database. In \application\config\database.php I have the following configuration:

$db['default']['hostname'] = 'localhost';
$db['default']['username'] = '<myusername>';
$db['default']['password'] = '<mypassword>';
$db['default']['database'] = 'heatmap';
$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;

When I try to load my http://localhost/heatmap/ page I only get a blank page. Nothing is displayed, and the page source is empty as well. No error thrown. I'm only trying to load the default page that comes with CodeIgniter. I did googled this problem, and none of the related problems I found solved my problem. My Postgres version is 9.1, PHP is 5.3.8.

3 Answers 3

5

I can only say what helped me. I just realized that i don't have php-postgre drivers in my system (Debian) Installing php5-pgsql worked for me. After this i had to set the

$db['default']['db_debug'] = FALSE;

And now everything works just fine.

Sign up to request clarification or add additional context in comments.

Comments

1

Check php.ini: extension=php_pgsql.dll

Check httpd.conf: LoadFile "C:/Program Files/PostgreSQL/9.3/bin/libpq.dll"

Reboot the apache.

Comments

0

Are you sure that the problem is caused by your database(configuration)? The default controller does not interact with the database and the database class is not loaded by default.

If you did load the database class yourself using $this->load->database(); then remove it and see if the default page is being displayed.

I would also recommend turning error_reporting() on so you can look through the logs and see what happens. More info on that topic can be found here.

3 Comments

I did so: removed database from autoload, the page loaded correctly. I'm not even using $this->load->database();, and the controller I'm using is the default controller that come with the framework.
Ok, so now we know that the problem is indeed caused by the database(connection). As suggested, take a look at the log.
If you do find the log, add it to your question. That would be helpful

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.