Welcome Guest, Not a member yet? Register   Sign In
Cannot autoload database
#1

[eluser]mistere[/eluser]
INITIAL CONFIGURATION:

System: Ubuntu 8.10
Installed CI 1.7.1 in /var/www/alpha
Installed Postgres 8.3.6
Postgres user account and database set up
Postgres accessible from command line (can log in, create tables, etc.)
Postgres accessible from network: localhost port 5432 using pgAdmin
In alpha/index.php (line 12): error_reporting(E_ALL);

RESULT:

Default CI page shows up at http://localhost/alpha/

SO FAR, SO GOOD.

CHANGE:

Add 'database' to the autoload.php file as follows:
$autoload['libraries'] = array('database');
Configure database parameters in database.php as follows:
$db['default']['hostname'] = "localhost";
$db['default']['username'] = "worker";
$db['default']['password'] = "password";
$db['default']['database'] = "workreport";
$db['default']['dbdriver'] = "postgre";
(these parameters work from the command line)

RESULT:
No page displays - there is nothing received by the browser
No errors appear in alpha/system/application/logs
No errors appear in /var/log/apache2/error.log

What am I missing here?
Thanks,
Eric
#2

[eluser]pistolPete[/eluser]
I think you have to configure the port as well:

From the User Guide:
Quote:port - The database port number. Currently only used with the Postgres driver. To use this value you have to add a line to the database config array.
Code:
$db['default']['port'] = 5432;
#3

[eluser]mistere[/eluser]
Great catch.

I added the port line to database.php - but there is no difference:
If I remove database from the autoload.php file the site works.
If I add database to the autoload.php file no pages render.

I got the logs to work (directory permissions problem)
and here is what I see:

DEBUG - 2009-03-03 10:44:49 --> Config Class Initialized
DEBUG - 2009-03-03 10:44:49 --> Hooks Class Initialized
DEBUG - 2009-03-03 10:44:49 --> URI Class Initialized
DEBUG - 2009-03-03 10:44:49 --> No URI present. Default controller set.
DEBUG - 2009-03-03 10:44:49 --> Router Class Initialized
DEBUG - 2009-03-03 10:44:49 --> Output Class Initialized
DEBUG - 2009-03-03 10:44:49 --> Input Class Initialized
DEBUG - 2009-03-03 10:44:49 --> Global POST and COOKIE data sanitized
DEBUG - 2009-03-03 10:44:49 --> Language Class Initialized
DEBUG - 2009-03-03 10:44:50 --> Loader Class Initialized
DEBUG - 2009-03-03 10:44:50 --> Database Driver Class Initialized
(END)

This is with log_threshold set to 4.

Any way I can get more detail?

Thanks,
Eric
#4

[eluser]mistere[/eluser]
I switched to mysql 5.0 and the default CI page displays now.

I really like Postgresql better so I'll have to keep trying that. I have several web apps running with Code Igniter 1.6.x and Postgresql 8.2.x. Something changed :-(
#5

[eluser]xwero[/eluser]
do a diff to see what changed in the database/drivers/postgre files. It would be great if you catch the bug.
#6

[eluser]mistere[/eluser]
I'll do that when I get a chance! I'm under a deadline this week :-)

Thanks
#7

[eluser]kmil0[/eluser]
Hi guys, I have the same problem but with CI 1.6.2,
The same machine (Ubuntu 8.10)
but the problem persist with Mysql 5.0 :S

not logs, not info, nothing :S
just a blank page only when I autoload the database library

in the CI log.

===============================

DEBUG - 2009-03-11 00:06:41 --> Config Class Initialized
DEBUG - 2009-03-11 00:06:41 --> Hooks Class Initialized
DEBUG - 2009-03-11 00:06:41 --> URI Class Initialized
DEBUG - 2009-03-11 00:06:41 --> Router Class Initialized
DEBUG - 2009-03-11 00:06:41 --> Output Class Initialized
DEBUG - 2009-03-11 00:06:41 --> Input Class Initialized
DEBUG - 2009-03-11 00:06:41 --> Global POST and COOKIE data sanitized
DEBUG - 2009-03-11 00:06:41 --> Language Class Initialized
DEBUG - 2009-03-11 00:06:41 --> Loader Class Initialized
DEBUG - 2009-03-11 00:06:41 --> Helpers loaded: url, form, text
DEBUG - 2009-03-11 00:06:41 --> Database Driver Class Initialized

===============================

an in the apache log

===============================

127.0.0.1 - - [11/Mar/2009:00:07:51 -0500] "GET / HTTP/1.1" 200 20 "-" "Mozilla/5.0 (X11; U; Linux i686; es-AR; rv:1.9.0.7) Gecko/2009030422 Ubuntu/8.10 (intrepid) Firefox/3.0.7"
===============================


in the Mysql Log (with log = /var/log/mysql/mysql.log )

theres no error no nothing..



in Ubuntu 8.04 works fine. but.. not now :S

any tip?
thanks guys Smile
#8

[eluser]Unknown[/eluser]
The same happened to me with mysql, after a clean php install.

Make sure you have the extension loaded in php (php_pgsql.dll / php_pdo_pqsql.dll)


edit:
Sorry, forgot its on Ubuntu Tongue

try something like
Code:
sudo apt-get install php5-pgsql
#9

[eluser]jedd[/eluser]
I really love what Ubuntu's done with my Debian ... {wistfully}

First step - crank up a phpinfo () page to confirm that you're loading all the bits you need to in PHP. Incredibly useful feature, phpinfo ...

Second, please confirm that you can authenticate using the user & pass and db name, using mysql at the CLI, as you have in the configuration file. Do it from the same host - not somewhere else - as MySQL has an ACL that can limit based on where you're coming from. Check the mysql database, specifically the user table, for more insight on the details.

Third, your apache log looks like you're hitting the web root - is that right? Do you have some funky rewrites in /etc/apache/... or in the local htaccess ..? By my understanding, the apache log should be showing /alpha as part of the URL it is trying to respond to / provide.

Fourth, we're assuming you've covered the easy stuff, eg. config/database.php changed:
Code:
$db['default']['dbdriver'] = "mysql";
#10

[eluser]kmil0[/eluser]
Hi guys.
thanks Smile
you have save my day Smile

seem that the problem was with de Mysql CLI authentication.
Ubuntu does not install php5-mysql by default.

thanks again for your support Smile




Theme © iAndrew 2016 - Forum software by © MyBB