CodeIgniter错误:消息:会话:已配置的驱动程序';文件';未找到.正在中止


CodeIgniter Error : Message: Session: Configured driver 'files' was not found. Aborting

类型:UnexpectedValueException

消息:会话:未找到配置的驱动程序"文件"。正在中止。

文件名:/var/www/html/m-caticket/system/librarys/Session.php

线路编号:230

回溯:

文件:/var/www/html/m-caticket/application/controllers/Home.php线路:8功能:__construct

文件:/var/www/html/m-caticket/index.php线路:292功能:需要一次

我从Windows复制了这个项目,我想把它放在Linux的localhost/m-take(/var/www/html/m-taket(中,我更改了base_urllocalhost/m-tiket,但我仍然收到了错误。

我读过这个会话:已配置的驱动程序';文件';未找到。正在中止

但它不能解决我的问题

这是我的自动加载.php

defined('BASEPATH') OR exit('No direct script access allowed');
$autoload['packages'] = array();
$autoload['libraries'] = array('database','session');
$autoload['drivers'] = array('files');
$autoload['helper'] = array('file');
$autoload['config'] = array();
$autoload['language'] = array();
$autoload['model'] = array();

在的一个控制器中也有一个助手

$this->load->helper(array('form', 'url', 'file', 'html', 'text', 'tgl', 'date'));

如果我从驱动程序自动加载中删除文件,它会返回到类型:UnexpectedValueException

首先,files不是一个有效的驱动程序,您要找的是一个file助手,它包含有助于处理文件的函数,所以你要做的就是打开autoload.php

中删除files

$autoload['drivers'] = array('files'); // remove files from this array

并在助手中添加file

$autoload['helper'] = array('file');

由于file是助手而非驱动程序,因此驱动程序可以是cachesessiondatabase

而且似乎你在保存会话时也有问题,所以这也需要以下步骤:

转到:

application/config/

并打开

config.php

找到$config['sess_save_path']并将其替换为:

$config['sess_save_path'] = sys_get_temp_dir();

我得到了解决方案。我已经检查了我的"/public_html/system/libraries/Session/drivers/Session_files_driver.php",可以看到<b>Session_files_driver.php</b>文件是空白的。我已经从另一个相同的文件中复制了代码。并将其放入CCD_ 13中进行求解。