?
Solved

Database config on Codeigniter

Posted on 2014-09-24
9
Medium Priority
?
337 Views
Last Modified: 2014-09-27
Hi,

I'm trying to connect to a database server that has a static IP.
If you do it with pgsql3 software works fine, but it doesn't work if you try with the Codeigniter database library.
It doesn't shows any errors, only a white page on everything that is on the same controller (the one which I'm using for the database connection).

Regards!
0
Comment
Question by:dimensionav
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 3
9 Comments
 
LVL 36

Expert Comment

by:Loganathan Natarajan
ID: 40343691
What is the host name given ? did you check with Code Igniter for Pgsql library?
0
 
LVL 36

Expert Comment

by:Loganathan Natarajan
ID: 40343693
First try some simple script way whether db is connected with hosting ip
<?php

$dbconn = pg_connect("host=sheep port=5432 dbname=mary user=lamb password=foo");

if (!$dbconn) {
  echo "An error occurred.\n";
  exit;
}

Open in new window

0
 

Author Comment

by:dimensionav
ID: 40345098
Hi

I've tried with the simple php connection and it worked (the one you used above). In my Codeigniter there's a library for postgres and i got no errors for that.

Is there anything else that I should check?

Regards!
0
WordPress Tutorial 4: Recommended Plugins

Now that you have WordPress installed, understand the interface, and know how to install new parts, let’s take a look at our recommended plugins.

 
LVL 36

Accepted Solution

by:
Loganathan Natarajan earned 2000 total points
ID: 40345394
did you enable this to view the errors?
 ini_set('display_errors', '1');
error_reporting(E_ALL); 

Open in new window

0
 
LVL 36

Expert Comment

by:Loganathan Natarajan
ID: 40345395
Have you set up like this in your config.php and check u have driver on database folder ?

$db['default']['hostname'] = 'localhost';
$db['default']['username'] = 'postgres';
$db['default']['password'] = 'postgres';
$db['default']['database'] = 'abc_gis';
$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;
$db['default']['port'] = 5432;
About these ads

Open in new window

0
 

Author Comment

by:dimensionav
ID: 40346159
Hi,

My connection has the same options that the one you used above, with the exception that my Database is in a remote server (not localhost). Is there any other thing that I should check?

Regards
0
 
LVL 36

Expert Comment

by:Loganathan Natarajan
ID: 40346250
Dido you enabled error reporting?
0
 

Author Comment

by:dimensionav
ID: 40348143
Hi!

Thanks, with the ini_set I got the error and fixed it!
I was only using the error_reporting(E_ALL);

Thank you!
0
 
LVL 36

Expert Comment

by:Loganathan Natarajan
ID: 40348271
I am glad that it helped. All the best
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I'd like to talk about something that is near and dear to my heart: build systems. Without them, building software is all about compiling locally, with software versions everywhere. It can be a mess. Today we are going to discuss building a small di…
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
The viewer will learn how to dynamically set the form action using jQuery.
Suggested Courses

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question