Skip to content

Commit

Permalink
Merge pull request #110 from devilbox/release-0.83
Browse files Browse the repository at this point in the history
Fix module installations
  • Loading branch information
cytopia authored Apr 19, 2019
2 parents 47e221e + 1e9cb5b commit 2ab9995
Show file tree
Hide file tree
Showing 5 changed files with 79 additions and 23 deletions.
3 changes: 1 addition & 2 deletions Dockerfiles/mods/Dockerfile-7.3
Original file line number Diff line number Diff line change
Expand Up @@ -379,9 +379,8 @@ RUN set -x \
# ---- Installing PHP Extension: swoole ----
&& git clone https://github.com/swoole/swoole-src /tmp/swoole \
&& cd /tmp/swoole \
&& git checkout master \
&& git checkout $(git describe --abbrev=0 --tags) \
&& phpize \
&& phpize \
&& ./configure \
--enable-openssl \
--enable-sockets \
Expand Down
5 changes: 2 additions & 3 deletions Dockerfiles/mods/Dockerfile-7.4
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ RUN set -x \
&& 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 \
&& ./configure --enable-redis \
&& make -j$(getconf _NPROCESSORS_ONLN) \
&& make install \
\
Expand Down Expand Up @@ -333,8 +333,7 @@ RUN set -x \
&& git clone https://github.com/swoole/swoole-src /tmp/swoole \
&& cd /tmp/swoole \
&& git checkout master \
&& git checkout $(git describe --abbrev=0 --tags) \
&& phpize \
&& phpize \
&& ./configure \
--enable-openssl \
--enable-sockets \
Expand Down
54 changes: 54 additions & 0 deletions Dockerfiles/mods/Dockerfile-8.0
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,32 @@ RUN set -x \
&& (rm -rf /usr/local/lib/php/test/memcached || true) \
&& (rm -rf /usr/local/lib/php/doc/memcached || true) \
\
# ---- Installing PHP Extension: mongodb ----
&& git clone https://github.com/mongodb/mongo-php-driver /tmp/mongodb \
&& cd /tmp/mongodb \
&& git submodule update --init \
# FIXME: This is a work-around to mitigate compile error with PHP 8.0
&& rgrep -I 'TSRMLS_C' | cut -d':' -f1 | sort -u | xargs -n1 sed -i'' 's/TSRMLS_C)/)/g' \
&& rgrep -I 'TSRMLS_C' | cut -d':' -f1 | sort -u | xargs -n1 sed -i'' 's/TSRMLS_C,/,/g' \
&& rgrep -I 'TSRMLS_CC' | cut -d':' -f1 | sort -u | xargs -n1 sed -i'' 's/TSRMLS_CC)/)/g' \
&& rgrep -I 'TSRMLS_CC' | cut -d':' -f1 | sort -u | xargs -n1 sed -i'' 's/TSRMLS_CC,/,/g' \
&& rgrep -I 'TSRMLS_DC' | cut -d':' -f1 | sort -u | xargs -n1 sed -i'' 's/TSRMLS_DC)/)/g' \
&& rgrep -I 'TSRMLS_DC' | cut -d':' -f1 | sort -u | xargs -n1 sed -i'' 's/TSRMLS_DC,/,/g' \
&& sed -i'' 's/TSRMLS_SET_CTX(ctx);/\/\/TSRMLS_SET_CTX(ctx);/g' php_phongo.c \
&& phpize \
&& ./configure --enable-mongodb \
&& make all \
&& make install \
\
&& docker-php-ext-enable mongodb \
&& (rm -rf /usr/local/lib/php/test/mongodb || true) \
&& (rm -rf /usr/local/lib/php/doc/mongodb || true) \
\
# ---- Installing PHP Extension: mysqli ----
&& /usr/local/bin/docker-php-ext-install -j$(getconf _NPROCESSORS_ONLN) mysqli \
&& (rm -rf /usr/local/lib/php/test/mysqli || true) \
&& (rm -rf /usr/local/lib/php/doc/mysqli || true) \
\
# ---- Installing PHP Extension: oci8 ----
&& ORACLE_HREF="$( curl -sS https://yum.oracle.com/repo/OracleLinux/OL7/oracle/instantclient/x86_64/ | tac | tac | grep -Eo 'href="getPackage/oracle-instantclient.+basiclite.+rpm"' | tail -1 )" \
&& ORACLE_VERSION_MAJOR="$( echo "${ORACLE_HREF}" | grep -Eo 'instantclient[.0-9]+' | sed 's/instantclient//g' )" \
Expand Down Expand Up @@ -270,6 +296,28 @@ RUN set -x \
&& (rm -rf /usr/local/lib/php/test/recode || true) \
&& (rm -rf /usr/local/lib/php/doc/recode || true) \
\
# ---- Installing PHP Extension: redis ----
&& git clone 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 \
# FIXME: This is a work-around to mitigate compile error with PHP 8.0
&& rgrep -I 'TSRMLS_C' | cut -d':' -f1 | sort -u | xargs -n1 sed -i'' 's/TSRMLS_C)/)/g' \
&& rgrep -I 'TSRMLS_C' | cut -d':' -f1 | sort -u | xargs -n1 sed -i'' 's/TSRMLS_C,/,/g' \
&& rgrep -I 'TSRMLS_CC' | cut -d':' -f1 | sort -u | xargs -n1 sed -i'' 's/TSRMLS_CC)/)/g' \
&& rgrep -I 'TSRMLS_CC' | cut -d':' -f1 | sort -u | xargs -n1 sed -i'' 's/TSRMLS_CC,/,/g' \
&& rgrep -I 'TSRMLS_DC' | cut -d':' -f1 | sort -u | xargs -n1 sed -i'' 's/TSRMLS_DC)/)/g' \
&& rgrep -I 'TSRMLS_DC' | cut -d':' -f1 | sort -u | xargs -n1 sed -i'' 's/TSRMLS_DC,/,/g' \
&& ./configure --enable-redis \
&& make -j$(getconf _NPROCESSORS_ONLN) \
&& 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) \
\
# ---- Installing PHP Extension: shmop ----
&& /usr/local/bin/docker-php-ext-install -j$(getconf _NPROCESSORS_ONLN) shmop \
&& (rm -rf /usr/local/lib/php/test/shmop || true) \
Expand Down Expand Up @@ -422,6 +470,10 @@ RUN set -x \
&& php-fpm -m | grep -oiE '^mbstring$' \
&& php -m | grep -oiE '^memcached$' \
&& php-fpm -m | grep -oiE '^memcached$' \
&& php -m | grep -oiE '^mongodb$' \
&& php-fpm -m | grep -oiE '^mongodb$' \
&& php -m | grep -oiE '^mysqli$' \
&& php-fpm -m | grep -oiE '^mysqli$' \
&& php -m | grep -oiE '^mysqlnd$' \
&& php-fpm -m | grep -oiE '^mysqlnd$' \
&& php -m | grep -oiE '^oci8$' \
Expand Down Expand Up @@ -459,6 +511,8 @@ RUN set -x \
&& php -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 '^reflection$' \
&& php-fpm -m | grep -oiE '^reflection$' \
&& php -m | grep -oiE '^session$' \
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,7 @@ Check out this table to see which Docker image provides what PHP modules.
<tr>
<th>8.0</th>
<td id="80-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>
<td id="80-mods">bcmath, bz2, calendar, Core, ctype, curl, date, dba, dom, enchant, exif, FFI, fileinfo, filter, ftp, gd, gettext, gmp, hash, iconv, interbase, intl, json, ldap, libxml, mbstring, memcached, mysqlnd, oci8, openssl, pcntl, pcre, PDO, pdo_dblib, PDO_Firebird, pdo_mysql, PDO_OCI, pdo_pgsql, pdo_sqlite, pgsql, Phar, posix, pspell, readline, recode, Reflection, session, shmop, SimpleXML, snmp, soap, sockets, sodium, SPL, sqlite3, standard, sysvmsg, sysvsem, sysvshm, tidy, tokenizer, xml, xmlreader, xmlrpc, xmlwriter, xsl, Zend OPcache, zip, zlib</td>
<td id="80-mods">bcmath, bz2, calendar, Core, ctype, curl, date, dba, dom, enchant, exif, FFI, fileinfo, filter, ftp, gd, gettext, gmp, hash, iconv, interbase, intl, json, ldap, libxml, mbstring, memcached, mongodb, mysqli, mysqlnd, oci8, openssl, pcntl, pcre, PDO, pdo_dblib, PDO_Firebird, pdo_mysql, PDO_OCI, pdo_pgsql, pdo_sqlite, pgsql, Phar, posix, pspell, readline, recode, redis, Reflection, session, shmop, SimpleXML, snmp, soap, sockets, sodium, SPL, sqlite3, standard, sysvmsg, sysvsem, sysvshm, tidy, tokenizer, xml, xmlreader, xmlrpc, xmlwriter, xsl, Zend OPcache, zip, zlib</td>
</tr>
</tbody>
</table>
Expand Down
38 changes: 21 additions & 17 deletions build/ansible/group_vars/all/mods.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# Extensions to enable (in defined order)
# -------------------------------------------------------------------------------------------------
extensions_enabled:
# ioncube must be loaded first
# # ioncube must be loaded first
- ioncube
- amqp
- apcu
Expand Down Expand Up @@ -484,7 +484,7 @@ extensions_available:
command: yes | pecl install mongo
build_dep: [libssl-dev, libsasl2-dev]
mongodb:
disabled: [5.2, 8.0] # TODO: fix for PHP 8.0
disabled: [5.2]
5.3:
type: pecl
version: 0.6.3
Expand All @@ -497,12 +497,13 @@ extensions_available:
command: |
git submodule update --init \
# FIXME: This is a work-around to mitigate compile error with PHP 8.0
&& rgrep 'TSRMLS_C' | cut -d':' -f1 | sort -u | xargs -n1 sed -i'' 's/TSRMLS_C)/)/g' \
&& rgrep 'TSRMLS_C' | cut -d':' -f1 | sort -u | xargs -n1 sed -i'' 's/TSRMLS_C,/,/g' \
&& rgrep 'TSRMLS_CC' | cut -d':' -f1 | sort -u | xargs -n1 sed -i'' 's/TSRMLS_CC)/)/g' \
&& rgrep 'TSRMLS_CC' | cut -d':' -f1 | sort -u | xargs -n1 sed -i'' 's/TSRMLS_CC,/,/g' \
&& rgrep 'TSRMLS_DC' | cut -d':' -f1 | sort -u | xargs -n1 sed -i'' 's/TSRMLS_DC)/)/g' \
&& rgrep 'TSRMLS_DC' | cut -d':' -f1 | sort -u | xargs -n1 sed -i'' 's/TSRMLS_DC,/,/g' \
&& rgrep -I 'TSRMLS_C' | cut -d':' -f1 | sort -u | xargs -n1 sed -i'' 's/TSRMLS_C)/)/g' \
&& rgrep -I 'TSRMLS_C' | cut -d':' -f1 | sort -u | xargs -n1 sed -i'' 's/TSRMLS_C,/,/g' \
&& rgrep -I 'TSRMLS_CC' | cut -d':' -f1 | sort -u | xargs -n1 sed -i'' 's/TSRMLS_CC)/)/g' \
&& rgrep -I 'TSRMLS_CC' | cut -d':' -f1 | sort -u | xargs -n1 sed -i'' 's/TSRMLS_CC,/,/g' \
&& rgrep -I 'TSRMLS_DC' | cut -d':' -f1 | sort -u | xargs -n1 sed -i'' 's/TSRMLS_DC)/)/g' \
&& rgrep -I 'TSRMLS_DC' | cut -d':' -f1 | sort -u | xargs -n1 sed -i'' 's/TSRMLS_DC,/,/g' \
&& sed -i'' 's/TSRMLS_SET_CTX(ctx);/\/\/TSRMLS_SET_CTX(ctx);/g' php_phongo.c \
&& phpize \
&& ./configure --enable-mongodb \
&& make all \
Expand Down Expand Up @@ -539,7 +540,6 @@ extensions_available:
type: builtin
run_dep: [libmysqlclient18]
mysqli:
disabled: [8.0] # TODO: Fixme
already_avail: [5.2]
all:
type: builtin
Expand Down Expand Up @@ -724,7 +724,6 @@ extensions_available:
build_dep: [librecode-dev]
run_dep: [librecode0]
redis:
disabled: [8.0] #TODO: fixme
5.2:
type: pecl
version: 2.2.7
Expand All @@ -737,7 +736,7 @@ extensions_available:
&& 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 \
&& ./configure --enable-redis \
&& make -j$(getconf _NPROCESSORS_ONLN) \
&& make install \
8.0:
Expand All @@ -749,7 +748,14 @@ extensions_available:
&& 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 \
# FIXME: This is a work-around to mitigate compile error with PHP 8.0
&& rgrep -I 'TSRMLS_C' | cut -d':' -f1 | sort -u | xargs -n1 sed -i'' 's/TSRMLS_C)/)/g' \
&& rgrep -I 'TSRMLS_C' | cut -d':' -f1 | sort -u | xargs -n1 sed -i'' 's/TSRMLS_C,/,/g' \
&& rgrep -I 'TSRMLS_CC' | cut -d':' -f1 | sort -u | xargs -n1 sed -i'' 's/TSRMLS_CC)/)/g' \
&& rgrep -I 'TSRMLS_CC' | cut -d':' -f1 | sort -u | xargs -n1 sed -i'' 's/TSRMLS_CC,/,/g' \
&& rgrep -I 'TSRMLS_DC' | cut -d':' -f1 | sort -u | xargs -n1 sed -i'' 's/TSRMLS_DC)/)/g' \
&& rgrep -I 'TSRMLS_DC' | cut -d':' -f1 | sort -u | xargs -n1 sed -i'' 's/TSRMLS_DC,/,/g' \
&& ./configure --enable-redis \
&& make -j$(getconf _NPROCESSORS_ONLN) \
&& make install \
all:
Expand Down Expand Up @@ -823,10 +829,9 @@ extensions_available:
7.3:
type: git
git_url: https://github.com/swoole/swoole-src
git_ref: master
git_ref: $(git describe --abbrev=0 --tags)
command: |
git checkout $(git describe --abbrev=0 --tags) \
&& phpize \
phpize \
&& ./configure \
--enable-openssl \
--enable-sockets \
Expand All @@ -842,8 +847,7 @@ extensions_available:
git_url: https://github.com/swoole/swoole-src
git_ref: master
command: |
git checkout $(git describe --abbrev=0 --tags) \
&& phpize \
phpize \
&& ./configure \
--enable-openssl \
--enable-sockets \
Expand Down

0 comments on commit 2ab9995

Please sign in to comment.