Skip to content

Commit 4569855

Browse files
authored
Merge pull request #60 from devilbox/release-0.46
Fix Redis for PHP 7.4
2 parents ab4f0e0 + dfe0f8c commit 4569855

File tree

3 files changed

+30
-2
lines changed

3 files changed

+30
-2
lines changed

Dockerfiles/mods/Dockerfile-7.4

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,21 @@ RUN set -x \
313313
&& (rm -rf /usr/local/lib/php/test/recode || true) \
314314
&& (rm -rf /usr/local/lib/php/doc/recode || true) \
315315
&& chmod +x "$(php -r 'echo ini_get("extension_dir");')"/* \
316+
&& git clone -v https://github.com/phpredis/phpredis /tmp/redis \
317+
&& cd /tmp/redis \
318+
&& phpize \
319+
&& sed -i'' 's/ZEND_ACC_CTOR | //g' redis.c \
320+
&& sed -i'' 's/ZEND_ACC_DTOR | //g' redis.c \
321+
&& sed -i'' 's/ZEND_ACC_CTOR | //g' redis_cluster.c \
322+
&& ./configure \
323+
&& make -j8 \
324+
&& make install \
325+
\
326+
&& docker-php-ext-enable redis \
327+
\
328+
&& (rm -rf /usr/local/lib/php/test/redis || true) \
329+
&& (rm -rf /usr/local/lib/php/doc/redis || true) \
330+
&& chmod +x "$(php -r 'echo ini_get("extension_dir");')"/* \
316331
&& pecl install rdkafka \
317332
&& docker-php-ext-enable rdkafka \
318333
\
@@ -589,6 +604,8 @@ RUN set -x \
589604
&& php-fpm -m | grep -oiE '^readline$' \
590605
&& php -m | grep -oiE '^recode$' \
591606
&& php-fpm -m | grep -oiE '^recode$' \
607+
&& php -m | grep -oiE '^redis$' \
608+
&& php-fpm -m | grep -oiE '^redis$' \
592609
&& php -m | grep -oiE '^rdkafka$' \
593610
&& php-fpm -m | grep -oiE '^rdkafka$' \
594611
&& php -m | grep -oiE '^session$' \

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -571,7 +571,7 @@ Check out this table to see which Docker image provides what PHP modules.
571571
<tr>
572572
<th>7.4</th>
573573
<td id="74-base">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</td>
574-
<td id="74-mods">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</td>
574+
<td id="74-mods">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</td>
575575
</tr>
576576
</tbody>
577577
</table>

build/ansible/group_vars/all.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1258,10 +1258,21 @@ extensions_available:
12581258
build_dep: [librecode-dev]
12591259
run_dep: [librecode0]
12601260
redis:
1261-
disabled: [7.4]
12621261
5.2:
12631262
type: pecl
12641263
version: 2.2.7
1264+
7.4:
1265+
type: git
1266+
git_url: https://github.com/phpredis/phpredis
1267+
# This is a nasty work-around to fix current phpredis implementation for PHP 7.4
1268+
command: |
1269+
phpize \
1270+
&& sed -i'' 's/ZEND_ACC_CTOR | //g' redis.c \
1271+
&& sed -i'' 's/ZEND_ACC_DTOR | //g' redis.c \
1272+
&& sed -i'' 's/ZEND_ACC_CTOR | //g' redis_cluster.c \
1273+
&& ./configure \
1274+
&& make -j8 \
1275+
&& make install \
12651276
all:
12661277
type: pecl
12671278
rdkafka:

0 commit comments

Comments
 (0)