Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Fatal error: session_start() after upgrading to Codeigniter 3

I upgraded from Codeigniter 2 to 3 and now I get this error with my CAS library:

A PHP Error was encountered

Severity: Error

Message: session_start() [function.session-start]: Failed to initialize storage module: user (path: C:\Windows\Temp)

Filename: CAS/Client.php

Line Number: 3588

Backtrace:

It has something to do with session, which I guess CI3.0 handles it differently from CI2.0.

I have the following in the config.php

$config['sess_driver'] = 'files';
$config['sess_cookie_name'] = 'ci_session';
$config['sess_expiration'] = 7200;
$config['sess_save_path'] = NULL;
$config['sess_match_ip'] = FALSE;
$config['sess_time_to_update'] = 300;
$config['sess_regenerate_destroy'] = FALSE

;

Any help will be highly appreciated. Thanks.

NEW:

I did a clean CI3.0.4 install and it seems like the problem is the CAS authentication library: https://github.com/eliasdorneles/code-igniter-cas-library

It worked with CI 2.x, but not with CI3.0. If I just not load the CAS module, everything works fine with regard to the session (I have no problem setting sessions, etc). But once I load the CAS there is a problem with the line session_start() at the CAS/Client.php. Any ideas?

like image 702
Mitteg Avatar asked Dec 25 '22 09:12

Mitteg


1 Answers

You have not configured your sess_save_path make sure folder also chmod 700

$config['sess_driver'] = 'files';
$config['sess_cookie_name'] = 'ci_session';
$config['sess_expiration'] = 7200;
$config['sess_save_path'] = FCPATH . 'application/cache/';
$config['sess_match_ip'] = FALSE;
$config['sess_time_to_update'] = 300;
$config['sess_regenerate_destroy'] = FALSE;

The autoload session

$autoload['libraries'] = array('session');
like image 159
Mr. ED Avatar answered Dec 28 '22 11:12

Mr. ED