LoginSignup
0
2

More than 5 years have passed since last update.

Laravel 5.3 でセッションドライバに Redis を用いた際にハマったこと

Posted at

事象

.env ファイルに SESSION_DRIVER=redis の記述を足して、REDIS_HOST 等も記述して「よっしゃ!」と意気揚々にデプロイを行ったところ Oops! した。

ログには次のようなメッセージが。

Symfony\Component\Debug\Exception\FatalThrowableError: Call to undefined method Illuminate\Cache\ApcStore::setConnection()

解決策

config/session.php を次のように変えればOK。

config/session.php(before)
<?php
return [
    // (略)
    'connection' => null,
    // (略)
    'store'      => 'memcached',
    // (略)
];
config/session.php(after)
<?php
return [
    // (略)
    'connection' => 'default',
    // (略)
    'store'      => null,
    // (略)
];
0
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
2