2015-08-25 4 views
0

Après la mise à jour php de la version 4 à 5.5, dans Kohana 3.3.3 a arrêté la session de travail .. Lorsque vous appelez: Session :: instance ('database') il y a une erreur: "Erreur de lecture des données de session."Pourquoi ne pas la session Kohana 3.3?

Pourquoi est-ce?

Session_Exception [ 1 ]: Error reading session data. 

SYSPATH/classes/Kohana/Session.php [ 324 ] 

319    } 
320   } 
321   catch (Exception $e) 
322   { 
323    // Error reading the session, usually a corrupt session. 
324    throw new Session_Exception('Error reading session data.', NULL, Session_Exception::SESSION_CORRUPT); 
325   } 
326 
327   if (is_array($data)) 
328   { 
329    // Load the data locally 

    SYSPATH/classes/Kohana/Session.php [ 125 ] » Kohana_Session->read(arguments) 

    MODPATH/database/classes/Kohana/Session/Database.php [ 74 ] » Kohana_Session->__construct(arguments) 

    SYSPATH/classes/Kohana/Session.php [ 54 ] » Kohana_Session_Database->__construct(arguments) 

    APPPATH/classes/Controller/Base.php [ 17 ] » Kohana_Session::instance(arguments) 

    APPPATH/classes/Controller/Index.php [ 9 ] » Controller_Base->before() 

    SYSPATH/classes/Kohana/Controller.php [ 69 ] » Controller_Index->before() 

    {PHP internal call} » Kohana_Controller->execute() 

    SYSPATH/classes/Kohana/Request/Client/Internal.php [ 97 ] » ReflectionMethod->invoke(arguments) 

    SYSPATH/classes/Kohana/Request/Client.php [ 114 ] » Kohana_Request_Client_Internal->execute_request(arguments) 

    SYSPATH/classes/Kohana/Request.php [ 997 ] » Kohana_Request_Client->execute(arguments) 

    DOCROOT/index.php [ 118 ] » Kohana_Request->execute() 

Répondre

0

Ajouter un var_dump ($ e) à l'intérieur du bloc catch dans le fichier Session.php de kohana où l'exception est en cours (comme dans le code que vous avez collé) et vous trouverez le vrai problème;)

1

Tout d'abord. Vérifiez le chemin d'accès à la sauvegarde de session à php ini et l'autorisation de catalogue pour enregistrer les fichiers de session. Dans mon cas c'était/tmp.

Goto/VAR/LOG et vérifier le journal des erreurs Apache.

Et puis, ouvrez SYSPATH/application/bootstrap.php Trouver

Kohana::init(array(
    'base_url' => '/', 
    'index_file' => FALSE, 
    'errors' => TRUE 
)); 

Modification

Kohana::init(array( 'base_url' => '/', 'index_file' => FALSE, 
'errors' => FALSE)); 

et vous verrez les erreurs forment votre interpréteur PHP de ou apache.

Si cela ne vous a pas aidé.

Recherche SYSPATH/classes/Kohana/session.php [324] et le remplacer

throw new Session_Exception('Error reading session data.', NULL, Session_Exception::SESSION_CORRUPT); 

et le remplacer à

throw new Session_Exception('Error reading session data.'. " [SID:".$id."(".$this->id()."), name:".$this->_name."][Details: " . $e . "]\n", NULL, Session_Exception::SESSION_CORRUPT); 

Et vous trouverez votre erreur de. Dans Mon cas c'était la base de données err.