php memcache获取不了session

代码是我目前的配置,已经开启memcached 服务,测试了多次不行 按照百度的文档操作

img

你这个用redis不香吗?


class Redis  extends \Redis
{

    public  function __construct()
    {
        $host = config('redis.host');
        $password = config('redis.password');
        $this->connect($host);
        $this->setOption(parent::OPT_READ_TIMEOUT,-1);
        if($password){
            $this->auth($password);
        }

    }


    public function auth($password)
    {
        parent::auth($password); // TODO: Change the autogenerated stub
    }


}

看一下这篇博客,希望可以解决您的问题,望采纳,谢谢!
php使用memcache存储session_weilee2009的专栏-CSDN博客 web服务器的php session都给memcached ,这样你不管分发器把 ip连接分给哪个web服务器都不会有问题了,配置方法很简单,就在php的配置文件内增加一条语句就可以了,不过前提你需要装好memcache模块1.设置session用memcache来存储方法I: 在 php.ini 中全局设置session.save_handler = memcache https://blog.csdn.net/weilee2009/article/details/7658260