Laravel 4 : Call to undefined method Redis::connection()

后端 未结 4 1028
情歌与酒
情歌与酒 2021-02-08 11:37

I\'m going crazy about this error. I\'ve got a vagrant VM with Debian 7, generated with Puphpet, installation was fine.

1. Redis is installed and working

4条回答
  •  孤街浪徒
    2021-02-08 11:56

    That error is because you have installed and enabled the module php5-redis, it became with the class Redis. To avoid that error and use the Laravel Redis Facade, you have to change the alias in app/config/app.php (or whatever is your environment).

    'Redis' => 'Illuminate\Support\Facades\Redis'

    'RedisFacade' => 'Illuminate\Support\Facades\Redis' //whatever you like

    or just configure your cache.php to use Redis and use only the Cache class. :)

提交回复
热议问题