用户
 找回密码
 入住 CI 中国社区
搜索
查看: 1336|回复: 2
收起左侧

[版本 2.x] 使用3.0的session,linux下提示找不到session

[复制链接]
发表于 2016-3-28 10:44:35 | 显示全部楼层 |阅读模式
Unable to load the requested class: session

我是在ci 2.1的基础上,把ci 3.0的session cache driver模块替换掉了。
然后在 windows 下一切测试正常。

更新到 linux 服务器下,提示 “Unable to load the requested class: session”

看目录结构,3.0的session.php移到了 Session/Session.php

不知道哪里出问题了。

windows的php是 3.3.10
linux的php是 3.3.3
 楼主| 发表于 2016-3-28 15:13:32 | 显示全部楼层
估计是大小写的问题,于是修改了 Loader.php 似乎有效。
暂时没有更新服务器,有待测试

1, 增加了ucfirst
        public function is_loaded($class)
        {
                if (isset($this->_ci_classes[ucfirst($class)]))
                {
                        return $this->_ci_classes[ucfirst($class)];
                }

                return FALSE;
        }

2,strtolower 改成 ucfirst
                if ($subdir == '')
                {
//                        $path = strtolower($class).'/'.$class;
                        $path = ucfirst($class).'/'.$class;
                        return $this->_ci_load_class($path, $params);
                }

                // If we got this far we were unable to find the requested class.
                // We do not issue errors if the load call failed due to a duplicate request
                if ($is_duplicate == FALSE)
                {
                        log_message('error', "Unable to load the requested class : ".$class);
                        show_error("Unable to load the requested class : ".$class);
                }
发表于 2016-3-29 21:07:20 | 显示全部楼层
将php.ini中的
session.auto_start = 0
更改为
session.auto_start = 1

本版积分规则