Reputation: 61
Fresh installation of tank_auth
library over Codeigniter 2.1.3.
When I try to access 'http://localhost/es/auth/register' gets following PHP error:
A PHP Error was encountered
Severity: Notice
Message: Undefined property: Auth::$db
Filename: libraries/Session.php
Line Number: 201
Everything seems to be configured and 'autoloaded'.
Edit: My '/application/config/autoload.php' file contains following lines:
$autoload['packages'] = array();
$autoload['libraries'] = array('database', 'session', 'xmlrpc','encrypt');
$autoload['helper'] = array('url', 'file');
$autoload['config'] = array();
$autoload['language'] = array();
$autoload['model'] = array();
What might be wrong?
Upvotes: -1
Views: 3951
Reputation: 1455
What about changing the array elements order? Just try to put 'session' before 'database', It is probably a stupid change - because the codeigniter sample is just like the one you have - but it's the only difference I can see with my environment:
$autoload['libraries'] = array('session', 'database');
$autoload['helper'] = array('array', 'url', 'form', 'string', 'date', 'language', 'static', 'cookie');
If it does not work you can try to manually load the database in the code, just to see any clue:
$this->load->database();
Ah, and take a look that your database settings will be ok in config file:
$config['hostname'] = "localhost";
$config['username'] = "myusername";
$config['password'] = "mypassword";
$config['database'] = "mydatabase";
$config['dbdriver'] = "mysql";
Keep an eye to your log config too:
$config['log_threshold'] = 4;
Maybe some problems related to pconnect? try it with FALSE value. Sorry if it does not help a lot, it's the only stuff that came to my mind.
Upvotes: 2