From dfe0f8c4b2bec1f0fa3a82e0b7e4ce655778fdd7 Mon Sep 17 00:00:00 2001 From: cytopia Date: Sat, 3 Nov 2018 03:17:04 +0100 Subject: [PATCH] Fix Redis for PHP 7.4 --- Dockerfiles/mods/Dockerfile-7.4 | 17 +++++++++++++++++ README.md | 2 +- build/ansible/group_vars/all.yml | 13 ++++++++++++- 3 files changed, 30 insertions(+), 2 deletions(-) diff --git a/Dockerfiles/mods/Dockerfile-7.4 b/Dockerfiles/mods/Dockerfile-7.4 index 90b4e75b..f1910308 100644 --- a/Dockerfiles/mods/Dockerfile-7.4 +++ b/Dockerfiles/mods/Dockerfile-7.4 @@ -313,6 +313,21 @@ RUN set -x \ && (rm -rf /usr/local/lib/php/test/recode || true) \ && (rm -rf /usr/local/lib/php/doc/recode || true) \ && chmod +x "$(php -r 'echo ini_get("extension_dir");')"/* \ + && git clone -v https://github.com/phpredis/phpredis /tmp/redis \ + && cd /tmp/redis \ + && phpize \ +&& sed -i'' 's/ZEND_ACC_CTOR | //g' redis.c \ +&& sed -i'' 's/ZEND_ACC_DTOR | //g' redis.c \ +&& sed -i'' 's/ZEND_ACC_CTOR | //g' redis_cluster.c \ +&& ./configure \ +&& make -j8 \ +&& make install \ + \ + && docker-php-ext-enable redis \ + \ + && (rm -rf /usr/local/lib/php/test/redis || true) \ + && (rm -rf /usr/local/lib/php/doc/redis || true) \ + && chmod +x "$(php -r 'echo ini_get("extension_dir");')"/* \ && pecl install rdkafka \ && docker-php-ext-enable rdkafka \ \ @@ -589,6 +604,8 @@ RUN set -x \ && php-fpm -m | grep -oiE '^readline$' \ && php -m | grep -oiE '^recode$' \ && php-fpm -m | grep -oiE '^recode$' \ + && php -m | grep -oiE '^redis$' \ + && php-fpm -m | grep -oiE '^redis$' \ && php -m | grep -oiE '^rdkafka$' \ && php-fpm -m | grep -oiE '^rdkafka$' \ && php -m | grep -oiE '^session$' \ diff --git a/README.md b/README.md index 4ad7d89e..50176b7c 100644 --- a/README.md +++ b/README.md @@ -571,7 +571,7 @@ Check out this table to see which Docker image provides what PHP modules. 7.4 Core, ctype, curl, date, dom, fileinfo, filter, ftp, hash, iconv, json, libxml, mbstring, mysqlnd, openssl, pcre, PDO, pdo_sqlite, Phar, posix, readline, Reflection, session, SimpleXML, sodium, SPL, sqlite3, standard, tokenizer, xml, xmlreader, xmlwriter, zlib - bcmath, bz2, calendar, Core, ctype, curl, date, dba, dom, enchant, exif, fileinfo, filter, ftp, gd, gettext, gmp, hash, iconv, igbinary, imap, interbase, intl, json, ldap, libxml, mbstring, memcached, mongodb, mysqli, mysqlnd, openssl, pcntl, pcre, PDO, pdo_dblib, PDO_Firebird, pdo_mysql, pdo_pgsql, pdo_sqlite, pgsql, Phar, posix, pspell, rdkafka, readline, recode, Reflection, session, shmop, SimpleXML, snmp, soap, sockets, sodium, SPL, sqlite3, standard, swoole, sysvmsg, sysvsem, sysvshm, tidy, tokenizer, uploadprogress, wddx, xml, xmlreader, xmlrpc, xmlwriter, xsl, Zend OPcache, zip, zlib + bcmath, bz2, calendar, Core, ctype, curl, date, dba, dom, enchant, exif, fileinfo, filter, ftp, gd, gettext, gmp, hash, iconv, igbinary, imap, interbase, intl, json, ldap, libxml, mbstring, memcached, mongodb, mysqli, mysqlnd, openssl, pcntl, pcre, PDO, pdo_dblib, PDO_Firebird, pdo_mysql, pdo_pgsql, pdo_sqlite, pgsql, Phar, posix, pspell, rdkafka, readline, recode, redis, Reflection, session, shmop, SimpleXML, snmp, soap, sockets, sodium, SPL, sqlite3, standard, swoole, sysvmsg, sysvsem, sysvshm, tidy, tokenizer, uploadprogress, wddx, xml, xmlreader, xmlrpc, xmlwriter, xsl, Zend OPcache, zip, zlib diff --git a/build/ansible/group_vars/all.yml b/build/ansible/group_vars/all.yml index 52f0600f..7fa2963a 100644 --- a/build/ansible/group_vars/all.yml +++ b/build/ansible/group_vars/all.yml @@ -1258,10 +1258,21 @@ extensions_available: build_dep: [librecode-dev] run_dep: [librecode0] redis: - disabled: [7.4] 5.2: type: pecl version: 2.2.7 + 7.4: + type: git + git_url: https://github.com/phpredis/phpredis + # This is a nasty work-around to fix current phpredis implementation for PHP 7.4 + command: | + phpize \ + && sed -i'' 's/ZEND_ACC_CTOR | //g' redis.c \ + && sed -i'' 's/ZEND_ACC_DTOR | //g' redis.c \ + && sed -i'' 's/ZEND_ACC_CTOR | //g' redis_cluster.c \ + && ./configure \ + && make -j8 \ + && make install \ all: type: pecl rdkafka: