Alex wood
Alex wood

Reputation: 163

Class 'CI_Driver_Library' not found codeigniter error

I want to use session, so I try to do autoload. In application > config.php, I do $autoload['libraries'] = array('session');

but I got below error

Message: Class 'CI_Driver_Library' not found

Filename: Session/Session.php

Upvotes: 3

Views: 2922

Answers (3)

jerinisready
jerinisready

Reputation: 994

file: url/application/config/config.php

CI Verson less than 3.0 have given cache and session as library functions.

$autoload['libraries'] = array('cache','session');

$autoload['drivers'] = array();

And for Verson 3.0 and greater

$autoload['libraries'] = array();

$autoload['drivers'] = array('cache','session');

remove both from library and then simply add it to drivers You might forget it to remove from library, this causes proper loading after resolving the problem;

Upvotes: 0

Chad
Chad

Reputation: 703

application/config/autoload.php

just to add to @Rizier123 answer.

Upvotes: 0

Rizier123
Rizier123

Reputation: 59681

If your using Codeigniter 3.0 or higher use this:

$autoload['drivers'] = array('session');

Because the session is a driver not a library after version 3.0!

Under Version 2.1 it's a library!

Upvotes: 7

Related Questions