when following the information for enabling Redis in Craft 3, my site just refreshes to a blank screen with a "Internal server error" generic message. Reviewing the server logs reveals:

ReflectionException: Class yii\redis\Cache does not exist in /storage/path/www/staging_html/vendor/yiisoft/yii2/di/Container.php:428

Talking with my hosting provider (Arcustech), informs me that Redis is indeed running and php-redis is installed. The details I entered into config\app.php were

return [
'components' => [
    'cache' => [
        'class' => yii\redis\Cache::class,
        'defaultDuration' => 86400,
        'redis' => [
            'hostname' => 'localhost',
            'port' => 6379,
            'database' => 0,

Any light that could be shone onto my predicament would be amazing. thanks!

  • 1
    Did you install the Yii2 library as well? Because it doesn't seem so Commented Jun 5, 2018 at 19:18
  • OK beginner comment, so forgive me, but where do I install the Yii2 library, in the main Craft directory?
    – rjdvsk
    Commented Jun 5, 2018 at 19:58
  • 2
    Take a look at this github.com/yiisoft/yii2-redis/blob/master/README.md. You require "yiisoft/yii2-redis": "~2.0.0". You should not have a main Craft directory in the best case Commented Jun 5, 2018 at 20:10

1 Answer 1


Turns out it was a beginners mistake, thank you to Robin in the comments above for setting me on the right track. All that was required to install was the Yii2 library, once this was done all worked as expected.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.