当我运行我的应用程序时,我总是得到一个未被捕获的异常。
我得到这样的错误:
An uncaught Exception was encountered
Type: UnexpectedValueException
Message: Session: Configured driver 'files' was not found. Aborting.
Filename: C:\xampp\htdocs\simatur\system\libraries\Session\Session.php
Line Number: 233
Backtrace:
File: C:\xampp\htdocs\simatur\application\third_party\HMVC\Loader.php
Line: 138
Function: library
File: C:\xampp\htdocs\simatur\application\third_party\HMVC\Loader.php
Line: 115
Function: library
File: C:\xampp\htdocs\simatur\application\controllers\Welcome.php
Line: 23
Function: __construct
File: C:\xampp\htdocs\simatur\index.php
Line: 317
Function: require_once
任何人都可以帮我解决这个问题吗?
这是我的autoload.php和config.php:
$autoload['packages'] = array();
$autoload['libraries'] = array('database', 'session', 'authentification', 'rpdb');
$autoload['drivers'] = array();
$autoload['helper'] = array('url', 'general', 'general_db');
$autoload['config'] = array();
$autoload['language'] = array();
$autoload['model'] = array(/*"Generalmodel" => "gm"*/);
和此:
$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;
$config['cookie_prefix'] = '';
$config['cookie_domain'] = '';
$config['cookie_path'] = '/';
$config['cookie_secure'] = FALSE;
$config['cookie_httponly'] = FALSE;
我已经尝试过在互联网上找到的所有内容,但它总是给我同样的错误。
请有人帮我解决这个问题。
谢谢...
答案 0 :(得分:0)
Old but Good Tutorial HMVC
您正在使用HMVC,您将控制器放在需要制作模块文件夹的错误文件夹中。只是类名和文件名只需要首字母大写。
application
application > modules > example
application > modules > example > controllers > Welcome.php
然后
<?php
class Welcome extends MX_Controller {
public function index() {
echo "hello";
}
}
网址示例
http://localhost/yourproject/index.php/example/welcome
https://bitbucket.org/wiredesignz/codeigniter-modular-extensions-hmvc
您可能需要加载错误
答案 1 :(得分:0)
如果您想加载驱动程序,请在autoload.php
中提及。因此,请将$autoload['drivers'] = array();
更改为
$autoload['drivers'] = array('session');
同时从session
$autoload['libraries'] = array('database', 'authentification', 'rpdb');