Laravel:在Illuminate \ Cache \ CacheManager.php中未定义缓存存储[predis]

时间:2018-09-19 18:16:06

标签: php laravel

我正在使用Laravel v5.7,每当我尝试使用axios发布到登录页面时,我都会收到500个内部服务器错误,并且在控制台的“网络”选项卡中,该特定文件返回此错误:

{
    message: "Cache store [predis] is not defined.", exception: "InvalidArgumentException",…}
    exception: "InvalidArgumentException"
    file: "...\laravel\framework\src\Illuminate\Cache\CacheManager.php"
    line: 96
    message: "Cache store [predis] is not defined."
}

3 个答案:

答案 0 :(得分:2)

在我的缓存中,无论我在环境中设置了哪个缓存存储,这都会失败,包括将其设置为默认的“文件”时会出现的情况。

再次检查您是否未更改config / Cache.php文件中的store属性的名称。

我发现我无意间在商店之间进行了更改。

如果您不以某种方式使用vc,Id建议您启动。找到本地人以及我的新作品后,我能以崭新的眼光迅速找到问题,并快速浏览最新提交。

Bad Commit

答案 1 :(得分:0)

  

在将Redis与Laravel结合使用之前,您需要安装   通过Composer的predis / predis软件包:

more detail

  composer require predis/predis

答案 2 :(得分:0)

我遇到了类似的问题,错误如下:

message: "Cache store [Database] is not defined.", exception: "InvalidArgumentException",…}

修复我在下面做的错误

在config里面打开cache.php并替换

 'database' => [
       'driver' => 'database',
       'table' => 'cache',
       'connection' => null,
     ],

 'Database' => [
           'driver' => 'Database',
           'table' => 'cache',
           'connection' => null,
         ],

解决了问题