dongshengyin0147 2016-01-29 12:33
浏览 373

session_start()导致CodeIgniter 3.0出现问题

I have a problem with the CAS authentication library in CI3. In CI2.x worked perfectly but with the CI3, the session has been re-designed and it seems to have problems with this library.

This is the error I get:

A PHP Error was encountered

Severity: Runtime Notice

Message: session_start() [function.session-start]: It is not safe to rely on the system's timezone settings. Please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Paris' for '1.0/no DST' instead

Filename: CAS/Client.php



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

Here is my config.php settings:

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

Note that I'm using a table called 'ci_sessions' in my database to store the session as stated in the CI3 user manual. It works perfectly but once I load the CAS library I get the previous error in the session_start() line.

CAS library extra info https://github.com/eliasdorneles/code-igniter-cas-library Someone wrote a code for easily integrate phpCAS into Codeigniter 2.X but it is no longer mantained nor updated to CI3.

For me, it is mandatory to use the CAS authentication method, any ideas on how to fix this error or use another alternative CAS client?

Thank you very much.

  • 写回答

2条回答 默认 最新

  • doubianyan9749 2016-01-29 12:55
    关注

    This is only indirectly connected to the session functions. Update your php.ini with a timezone:

    [Date]
    ; Defines the default timezone used by the date functions
    ; http://php.net/date.timezone
    date.timezone = Europe/Berlin
    
    评论

报告相同问题?