Welcome Guest, Not a member yet? Register   Sign In
Trying to debug a DB problem (load and autoload)
#1

[eluser]Unknown[/eluser]
Hi there,

(i had put this in an old thread, relocating here as it's a different issue I believe)

I'm loading up CI 2.1.3 on my shared linux host but as soon as I load or autoload the database, my CI 2.1.3 install white screens. CI works like a charm on my localhost wamp setup. On my shared linux hosting, blank pages. (unless I don’t load the DB, then I get the ‘Welcome’)

I’m not a server admin, but from what I can see it should be able to run CI. I’ve had every major CMS on this host run in the past few years. Wordpress, Joomla, Pligg, etc.. They all make heavy use of mysql, so I’m stumped as to why loading the database with CI is causing it to http 500 with a blank page. I also run phpmyadmin on this same host and it is fine.

This is a blank vanilla install with CI 2.1.3. Not one line of custom code yet.

PHP Version 5.2.12
Mysql Client API version 4.1.10a

My config file is correct. In fact if I run this app on my localhost using the same DB credentials, I am actually able to connect to my remote hosting database and insert and read data!

Update: Since I was getting this failure from either
Code:
$this->load->library('database');
or
Code:
$autoload['libraries'] = array('database');
I decided to try this approach:

Code:
$dsn = 'dbdriver://username:password@hostname/database';
$this->load->database($dsn);

With this approach I did get some useful errors:


A PHP Error was encountered

Severity: Warning

Message: require_once(/sites/foo/bar/home/public_html/system/database/drivers/dbdriver/dbdriver_driver.php) [function.require-once]: failed to open stream: No such file or directory

Filename: database/DB.php

Line Number: 140

Now I have no idea how that path was generated, but it seems like upon transferring the CI files from my working localhost (wamp) env to the shared linux host, paths are not getting calculated correctly causing the app to whitescreen.

Thanks in advance for any ideas, tips, suggestions, or well wishes.

:-)

#2

[eluser]vitoco[/eluser]
This error it's telling you that the DB class it's trying to load the "dbdriver" driver for the active connection.
Code:
A PHP Error was encountered

Severity: Warning

Message: require_once(/sites/foo/bar/home/public_html/system/database/drivers/dbdriver/dbdriver_driver.php) [function.require-once]: failed to open stream: No such file or directory

Filename: database/DB.php

Line Number: 140

Line 140 database/DB.php :
Code:
require_once(BASEPATH.'database/drivers/'.$params['dbdriver'].'/'.$params['dbdriver'].'_driver.php');

But that driver doesn't exists, and checking the drivers folder i get this list of posible values
Code:
cubrid, mssql, mysql, mysqli, oci8, odbc, pdo, postgre, sqlite, sqlsrv

So i don't know what type of database engine you are working with, but you must check the ['dbdriver'] value on your database.php file.




Theme © iAndrew 2016 - Forum software by © MyBB