I have just upgraded from Magento 2.1.9 to 2.2.8.

Redis was previously working fine, however, when I activate it now through my env.php file, I am receiving this error.

Warning: substr() expects parameter 1 to be string, object given in /http/vendor/colinmollenhour/cache-backend-redis/Cm/Cache/Backend/Redis.php on line 1188","1":"1 substr() called at [vendor/colinmollenhour/cache-backend-redis/Cm/Cache/Backend/Redis.php:1188]

What could be causing this?

When i comment out the Redis configuration in the env.php file, the site works okay but it will not show any updates.

I have tried rm -rf var/generation var/di and all other normally necessary commands but none of them seem to work.


1 Answer 1


Generation directory is no longer in var. There seems to be something wrong with your env configuration or with data already cached in Redis. To configure env correctly use

bin/magento setup:config:set --cache-backend=redis --page-cache=redis

To clear existing redis cache use flushall inside redis-cli

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.