无法在Redis中存储会话

时间:2015-05-19 16:13:22

标签: php redis

所以,我XAMPP PHP 5.5.24Redis已安装set。我可以get中的Redis$redis = new Redis(); $redis->connect('127.0.0.1', 6379); $redis->set("var","val"); // it is working ok 变量,如:

session.save_handler

我现在想要的是在Redis中存储会话。所以,我在我的session.save_path中配置了php.inisession.save_handler = redis session.save_path = "tcp://localhost:6379?weight=1" ,如此:

Warning: session_start(): in C:\....

Fatal error: Uncaught exception 'RedisException' with message 'Connection  closed'

但它不起作用。我只是得到了这些错误:

session.save_path = "tcp://localhost:6379/"

我试过了:

session.save_path = "localhost:6379"

和此:

public partial class School
    {
        public School()
        {
            this.Students = new HashSet<Student>();
        }

        public System.Guid Type { get; set; }
        public int InternalID { get; set; }

        public virtual ICollection<Student> Students { get; set; }
    }

但仍然看到相同的错误。

修改

顺便说一下,我从here

安装了Redis

0 个答案:

没有答案