所以,我XAMPP
PHP 5.5.24
,Redis
已安装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.ini
和session.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