Skip to content

Commit 95b75af

Browse files
committed
fix PHP 7.3 setup
Install `redis` extension, required by test_redis, in correct version.
1 parent cc6c16b commit 95b75af

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

files/Dockerfile

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,16 @@ COPY --from=composer ["/usr/bin/composer", "/usr/bin/composer"]
107107
# the mysql tests a separate machine running mysql server 5.6 is required.
108108
RUN docker-php-ext-install pdo pdo_mysql
109109

110-
# redis
111-
RUN pecl install redis && docker-php-ext-enable redis
110+
# install redis extension required by test_redis:
111+
RUN \
112+
php_cmp=$(php -r "echo version_compare(PHP_VERSION, '7.4.0', '>=');"); \
113+
if [ "$php_cmp" = 1 ]; then \
114+
# install latest redis for PHPs >= 7.4
115+
echo 'no' | pecl install redis; \
116+
else \
117+
# install redis-4.3.0 - last one with support for php 7.2
118+
echo 'no' | pecl install redis-4.3.0; \
119+
fi && docker-php-ext-enable redis
112120

113121
# memcache
114122
# Pre 8.0 requires 4.0.5.2

0 commit comments

Comments
 (0)