session加载错误
控制器代码: $this->load->library('session');$user=array('id'=>3,'name'=>'jack');
$this->session->set_userdata('user',$user);
结果发生错误
A PHP Error was encounteredSeverity: Warning
Message: mkdir() : Invalid argument
Filename: drivers/Session_files_driver.php
Line Number: 117
Backtrace:
File: E:\amp\apache\htdocs\mvc\application\controllers\user.php
Line: 75
Function: libraryFile: E:\amp\apache\htdocs\mvc\index.php
Line: 292
Function: require_once
An uncaught Exception was encounteredType: Exception
Message: Session: Configured save path '' is not a directory, doesn't exist or cannot be created.
Filename: E:\amp\apache\htdocs\mvc\system\libraries\Session\drivers\Session_files_driver.php
Line Number: 119
Backtrace:
File: E:\amp\apache\htdocs\mvc\application\controllers\user.php
Line: 75
Function: libraryFile: E:\amp\apache\htdocs\mvc\index.php
Line: 292
Function: require_once
$config['sess_save_path'] =BASEPATH.'../'.'session_file';
session文件夹存在根目录下,session_file文件夹会自动建立,收工 Configured save path '' is not a directory, doesn't exist or cannot be created.
路径有误,config中没配置默认会使用php.ini中的配置 application/config/config.php
在大概行257左右加入$config['sess_save_path'] ='tmp';
我试过改tmp为其它值不行,只有这样才行,仅供参考 谢谢大神们 smartweb 发表于 2015-10-12 20:00
$config['sess_save_path'] =BASEPATH.'../'.'session_file';
session文件夹存在根目录下,session_file文 ...
万分感谢!
纠结了一下午了快 smartweb 发表于 2015-10-12 19:14
application/config/config.php
在大概行257左右加入$config['sess_save_path'] ='tmp';
我试过改tmp为其它 ...
我试了一下不行?
config.php 配置好路径
smartweb 发表于 2015-10-12 20:00
$config['sess_save_path'] =BASEPATH.'../'.'session_file';
session文件夹存在根目录下,session_file文 ...
此法经验证,可行。 smartweb 发表于 2015-10-12 20:00
$config['sess_save_path'] =BASEPATH.'../'.'session_file';
session文件夹存在根目录下,session_file文 ...
此法经验证,可行。{:1_1:}
页:
[1]
2