diff --git a/plugins/templates/before-script-redis.yml b/plugins/templates/before-script-redis.yml
index 90f2d1f3521556f65484bd87503567ca2106473c..9da2e6f7eefce0089a2603c1ee29f9a2f189201f 100644
--- a/plugins/templates/before-script-redis.yml
+++ b/plugins/templates/before-script-redis.yml
@@ -16,5 +16,10 @@ before_script:
   - composer global require yoast/phpunit-polyfills
 
   # PECL Redis module
-  - pecl install redis
+  - |
+    if [[ $(php -v) =~ "PHP 5.6" ]]; then
+      pecl install redis-2.2.8
+    elif
+      pecl install redis
+    fi
   - echo "extension=redis.so" > /usr/local/etc/php/conf.d/redis.ini