From 2f953cd06259f37b1707219a5e98ada6bcc44bb7 Mon Sep 17 00:00:00 2001 From: cytopia Date: Sun, 23 Dec 2018 00:15:04 +0100 Subject: [PATCH] Add PHP modules: sqlsrv and pdo_sqlsrv for MsSQL --- Dockerfiles/mods/Dockerfile-7.0 | 18 ++++++++++++++++++ Dockerfiles/mods/Dockerfile-7.1 | 18 ++++++++++++++++++ Dockerfiles/mods/Dockerfile-7.2 | 18 ++++++++++++++++++ Dockerfiles/mods/Dockerfile-7.3 | 18 ++++++++++++++++++ README.md | 8 ++++---- build/ansible/group_vars/all.yml | 24 ++++++++++++++++++++++++ 6 files changed, 100 insertions(+), 4 deletions(-) diff --git a/Dockerfiles/mods/Dockerfile-7.0 b/Dockerfiles/mods/Dockerfile-7.0 index 4dac7658..11efb996 100644 --- a/Dockerfiles/mods/Dockerfile-7.0 +++ b/Dockerfiles/mods/Dockerfile-7.0 @@ -54,6 +54,7 @@ ENV BUILD_DEPS \ libxslt-dev \ libzip-dev \ snmp \ + unixodbc-dev \ zlib1g-dev \ ca-certificates \ git @@ -83,6 +84,7 @@ ENV RUN_DEPS \ libxslt1.1 \ libzip4 \ snmp \ + unixodbc \ ca-certificates @@ -282,6 +284,12 @@ RUN set -x \ && (rm -rf /usr/local/lib/php/test/pdo_pgsql || true) \ && (rm -rf /usr/local/lib/php/doc/pdo_pgsql || true) \ \ +# ---- Installing PHP Extension: pdo_sqlsrv ---- + && pecl install pdo_sqlsrv \ + && docker-php-ext-enable pdo_sqlsrv \ + && (rm -rf /usr/local/lib/php/test/pdo_sqlsrv || true) \ + && (rm -rf /usr/local/lib/php/doc/pdo_sqlsrv || true) \ + \ # ---- Installing PHP Extension: pgsql ---- && /usr/local/bin/docker-php-ext-install -j$(getconf _NPROCESSORS_ONLN) pgsql \ && (rm -rf /usr/local/lib/php/test/pgsql || true) \ @@ -340,6 +348,12 @@ RUN set -x \ && (rm -rf /usr/local/lib/php/test/sockets || true) \ && (rm -rf /usr/local/lib/php/doc/sockets || true) \ \ +# ---- Installing PHP Extension: sqlsrv ---- + && pecl install sqlsrv \ + && docker-php-ext-enable sqlsrv \ + && (rm -rf /usr/local/lib/php/test/sqlsrv || true) \ + && (rm -rf /usr/local/lib/php/doc/sqlsrv || true) \ + \ # ---- Installing PHP Extension: swoole ---- && pecl install swoole \ && docker-php-ext-enable swoole \ @@ -531,6 +545,8 @@ RUN set -x \ && php-fpm -m | grep -oiE '^pdo_pgsql$' \ && php -m | grep -oiE '^pdo_sqlite$' \ && php-fpm -m | grep -oiE '^pdo_sqlite$' \ + && php -m | grep -oiE '^pdo_sqlsrv$' \ + && php-fpm -m | grep -oiE '^pdo_sqlsrv$' \ && php -m | grep -oiE '^pgsql$' \ && php-fpm -m | grep -oiE '^pgsql$' \ && php -m | grep -oiE '^phalcon$' \ @@ -561,6 +577,8 @@ RUN set -x \ && php-fpm -m | grep -oiE '^soap$' \ && php -m | grep -oiE '^sockets$' \ && php-fpm -m | grep -oiE '^sockets$' \ + && php -m | grep -oiE '^sqlsrv$' \ + && php-fpm -m | grep -oiE '^sqlsrv$' \ && php -m | grep -oiE '^swoole$' \ && php-fpm -m | grep -oiE '^swoole$' \ && php -m | grep -oiE '^sysvmsg$' \ diff --git a/Dockerfiles/mods/Dockerfile-7.1 b/Dockerfiles/mods/Dockerfile-7.1 index 827d8641..566763f0 100644 --- a/Dockerfiles/mods/Dockerfile-7.1 +++ b/Dockerfiles/mods/Dockerfile-7.1 @@ -54,6 +54,7 @@ ENV BUILD_DEPS \ libxslt-dev \ libzip-dev \ snmp \ + unixodbc-dev \ zlib1g-dev \ ca-certificates \ git @@ -83,6 +84,7 @@ ENV RUN_DEPS \ libxslt1.1 \ libzip4 \ snmp \ + unixodbc \ ca-certificates @@ -277,6 +279,12 @@ RUN set -x \ && (rm -rf /usr/local/lib/php/test/pdo_pgsql || true) \ && (rm -rf /usr/local/lib/php/doc/pdo_pgsql || true) \ \ +# ---- Installing PHP Extension: pdo_sqlsrv ---- + && pecl install pdo_sqlsrv \ + && docker-php-ext-enable pdo_sqlsrv \ + && (rm -rf /usr/local/lib/php/test/pdo_sqlsrv || true) \ + && (rm -rf /usr/local/lib/php/doc/pdo_sqlsrv || true) \ + \ # ---- Installing PHP Extension: pgsql ---- && /usr/local/bin/docker-php-ext-install -j$(getconf _NPROCESSORS_ONLN) pgsql \ && (rm -rf /usr/local/lib/php/test/pgsql || true) \ @@ -335,6 +343,12 @@ RUN set -x \ && (rm -rf /usr/local/lib/php/test/sockets || true) \ && (rm -rf /usr/local/lib/php/doc/sockets || true) \ \ +# ---- Installing PHP Extension: sqlsrv ---- + && pecl install sqlsrv \ + && docker-php-ext-enable sqlsrv \ + && (rm -rf /usr/local/lib/php/test/sqlsrv || true) \ + && (rm -rf /usr/local/lib/php/doc/sqlsrv || true) \ + \ # ---- Installing PHP Extension: swoole ---- && pecl install swoole \ && docker-php-ext-enable swoole \ @@ -526,6 +540,8 @@ RUN set -x \ && php-fpm -m | grep -oiE '^pdo_pgsql$' \ && php -m | grep -oiE '^pdo_sqlite$' \ && php-fpm -m | grep -oiE '^pdo_sqlite$' \ + && php -m | grep -oiE '^pdo_sqlsrv$' \ + && php-fpm -m | grep -oiE '^pdo_sqlsrv$' \ && php -m | grep -oiE '^pgsql$' \ && php-fpm -m | grep -oiE '^pgsql$' \ && php -m | grep -oiE '^phalcon$' \ @@ -558,6 +574,8 @@ RUN set -x \ && php-fpm -m | grep -oiE '^soap$' \ && php -m | grep -oiE '^sockets$' \ && php-fpm -m | grep -oiE '^sockets$' \ + && php -m | grep -oiE '^sqlsrv$' \ + && php-fpm -m | grep -oiE '^sqlsrv$' \ && php -m | grep -oiE '^swoole$' \ && php-fpm -m | grep -oiE '^swoole$' \ && php -m | grep -oiE '^sysvmsg$' \ diff --git a/Dockerfiles/mods/Dockerfile-7.2 b/Dockerfiles/mods/Dockerfile-7.2 index eaa8c9af..f7f3cc10 100644 --- a/Dockerfiles/mods/Dockerfile-7.2 +++ b/Dockerfiles/mods/Dockerfile-7.2 @@ -54,6 +54,7 @@ ENV BUILD_DEPS \ libxslt-dev \ libzip-dev \ snmp \ + unixodbc-dev \ zlib1g-dev \ ca-certificates \ git @@ -83,6 +84,7 @@ ENV RUN_DEPS \ libxslt1.1 \ libzip4 \ snmp \ + unixodbc \ ca-certificates @@ -278,6 +280,12 @@ RUN set -x \ && (rm -rf /usr/local/lib/php/test/pdo_pgsql || true) \ && (rm -rf /usr/local/lib/php/doc/pdo_pgsql || true) \ \ +# ---- Installing PHP Extension: pdo_sqlsrv ---- + && pecl install pdo_sqlsrv \ + && docker-php-ext-enable pdo_sqlsrv \ + && (rm -rf /usr/local/lib/php/test/pdo_sqlsrv || true) \ + && (rm -rf /usr/local/lib/php/doc/pdo_sqlsrv || true) \ + \ # ---- Installing PHP Extension: pgsql ---- && /usr/local/bin/docker-php-ext-install -j$(getconf _NPROCESSORS_ONLN) pgsql \ && (rm -rf /usr/local/lib/php/test/pgsql || true) \ @@ -336,6 +344,12 @@ RUN set -x \ && (rm -rf /usr/local/lib/php/test/sockets || true) \ && (rm -rf /usr/local/lib/php/doc/sockets || true) \ \ +# ---- Installing PHP Extension: sqlsrv ---- + && pecl install sqlsrv \ + && docker-php-ext-enable sqlsrv \ + && (rm -rf /usr/local/lib/php/test/sqlsrv || true) \ + && (rm -rf /usr/local/lib/php/doc/sqlsrv || true) \ + \ # ---- Installing PHP Extension: swoole ---- && pecl install swoole \ && docker-php-ext-enable swoole \ @@ -527,6 +541,8 @@ RUN set -x \ && php-fpm -m | grep -oiE '^pdo_pgsql$' \ && php -m | grep -oiE '^pdo_sqlite$' \ && php-fpm -m | grep -oiE '^pdo_sqlite$' \ + && php -m | grep -oiE '^pdo_sqlsrv$' \ + && php-fpm -m | grep -oiE '^pdo_sqlsrv$' \ && php -m | grep -oiE '^pgsql$' \ && php-fpm -m | grep -oiE '^pgsql$' \ && php -m | grep -oiE '^phalcon$' \ @@ -561,6 +577,8 @@ RUN set -x \ && php-fpm -m | grep -oiE '^sockets$' \ && php -m | grep -oiE '^sodium$' \ && php-fpm -m | grep -oiE '^sodium$' \ + && php -m | grep -oiE '^sqlsrv$' \ + && php-fpm -m | grep -oiE '^sqlsrv$' \ && php -m | grep -oiE '^swoole$' \ && php-fpm -m | grep -oiE '^swoole$' \ && php -m | grep -oiE '^sysvmsg$' \ diff --git a/Dockerfiles/mods/Dockerfile-7.3 b/Dockerfiles/mods/Dockerfile-7.3 index 70bce3ae..5a72471f 100644 --- a/Dockerfiles/mods/Dockerfile-7.3 +++ b/Dockerfiles/mods/Dockerfile-7.3 @@ -54,6 +54,7 @@ ENV BUILD_DEPS \ libxslt-dev \ libzip-dev \ snmp \ + unixodbc-dev \ zlib1g-dev \ ca-certificates \ git @@ -82,6 +83,7 @@ ENV RUN_DEPS \ libxslt1.1 \ libzip4 \ snmp \ + unixodbc \ ca-certificates @@ -237,6 +239,12 @@ RUN set -x \ && (rm -rf /usr/local/lib/php/test/pdo_pgsql || true) \ && (rm -rf /usr/local/lib/php/doc/pdo_pgsql || true) \ \ +# ---- Installing PHP Extension: pdo_sqlsrv ---- + && pecl install pdo_sqlsrv-5.5.0preview \ + && docker-php-ext-enable pdo_sqlsrv \ + && (rm -rf /usr/local/lib/php/test/pdo_sqlsrv || true) \ + && (rm -rf /usr/local/lib/php/doc/pdo_sqlsrv || true) \ + \ # ---- Installing PHP Extension: pgsql ---- && /usr/local/bin/docker-php-ext-install -j$(getconf _NPROCESSORS_ONLN) pgsql \ && (rm -rf /usr/local/lib/php/test/pgsql || true) \ @@ -286,6 +294,12 @@ RUN set -x \ && (rm -rf /usr/local/lib/php/test/sockets || true) \ && (rm -rf /usr/local/lib/php/doc/sockets || true) \ \ +# ---- Installing PHP Extension: sqlsrv ---- + && pecl install sqlsrv-5.5.0preview \ + && docker-php-ext-enable sqlsrv \ + && (rm -rf /usr/local/lib/php/test/sqlsrv || true) \ + && (rm -rf /usr/local/lib/php/doc/sqlsrv || true) \ + \ # ---- Installing PHP Extension: swoole ---- && git clone https://github.com/swoole/swoole-src /tmp/swoole \ && cd /tmp/swoole \ @@ -482,6 +496,8 @@ RUN set -x \ && php-fpm -m | grep -oiE '^pdo_pgsql$' \ && php -m | grep -oiE '^pdo_sqlite$' \ && php-fpm -m | grep -oiE '^pdo_sqlite$' \ + && php -m | grep -oiE '^pdo_sqlsrv$' \ + && php-fpm -m | grep -oiE '^pdo_sqlsrv$' \ && php -m | grep -oiE '^pgsql$' \ && php-fpm -m | grep -oiE '^pgsql$' \ && php -m | grep -oiE '^phar$' \ @@ -514,6 +530,8 @@ RUN set -x \ && php-fpm -m | grep -oiE '^sockets$' \ && php -m | grep -oiE '^sodium$' \ && php-fpm -m | grep -oiE '^sodium$' \ + && php -m | grep -oiE '^sqlsrv$' \ + && php-fpm -m | grep -oiE '^sqlsrv$' \ && php -m | grep -oiE '^swoole$' \ && php-fpm -m | grep -oiE '^swoole$' \ && php -m | grep -oiE '^sysvmsg$' \ diff --git a/README.md b/README.md index 59da56e0..3a889f86 100644 --- a/README.md +++ b/README.md @@ -551,22 +551,22 @@ Check out this table to see which Docker image provides what PHP modules. 7.0 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, SPL, sqlite3, standard, tokenizer, xml, xmlreader, xmlwriter, zlib - amqp, apcu, bcmath, bz2, calendar, Core, ctype, curl, date, dba, dom, enchant, exif, fileinfo, filter, ftp, gd, gettext, gmp, hash, iconv, igbinary, imagick, imap, interbase, intl, json, ldap, libxml, mbstring, mcrypt, memcache, memcached, mongodb, msgpack, mysqli, mysqlnd, openssl, pcntl, pcre, PDO, pdo_dblib, PDO_Firebird, pdo_mysql, pdo_pgsql, pdo_sqlite, pgsql, phalcon, Phar, posix, pspell, rdkafka, readline, recode, redis, Reflection, session, shmop, SimpleXML, snmp, soap, sockets, SPL, sqlite3, standard, swoole, sysvmsg, sysvsem, sysvshm, tidy, tokenizer, uploadprogress, wddx, xdebug, xml, xmlreader, xmlrpc, xmlwriter, xsl, Zend OPcache, zip, zlib + amqp, apcu, bcmath, bz2, calendar, Core, ctype, curl, date, dba, dom, enchant, exif, fileinfo, filter, ftp, gd, gettext, gmp, hash, iconv, igbinary, imagick, imap, interbase, intl, json, ldap, libxml, mbstring, mcrypt, memcache, memcached, mongodb, msgpack, mysqli, mysqlnd, openssl, pcntl, pcre, PDO, pdo_dblib, PDO_Firebird, pdo_mysql, pdo_pgsql, pdo_sqlite, pdo_sqlsrv, pgsql, phalcon, Phar, posix, pspell, rdkafka, readline, recode, redis, Reflection, session, shmop, SimpleXML, snmp, soap, sockets, SPL, sqlite3, sqlsrv, standard, swoole, sysvmsg, sysvsem, sysvshm, tidy, tokenizer, uploadprogress, wddx, xdebug, xml, xmlreader, xmlrpc, xmlwriter, xsl, Zend OPcache, zip, zlib 7.1 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, SPL, sqlite3, standard, tokenizer, xml, xmlreader, xmlwriter, zlib - amqp, apcu, bcmath, bz2, calendar, Core, ctype, curl, date, dba, dom, enchant, exif, fileinfo, filter, ftp, gd, gettext, gmp, hash, iconv, igbinary, imagick, imap, interbase, intl, json, ldap, libxml, mbstring, mcrypt, memcache, memcached, mongodb, msgpack, mysqli, mysqlnd, openssl, pcntl, pcre, PDO, pdo_dblib, PDO_Firebird, pdo_mysql, pdo_pgsql, pdo_sqlite, pgsql, phalcon, Phar, posix, pspell, rdkafka, readline, recode, redis, Reflection, session, shmop, SimpleXML, snmp, soap, sockets, SPL, sqlite3, standard, swoole, sysvmsg, sysvsem, sysvshm, tidy, tokenizer, uploadprogress, wddx, xdebug, xml, xmlreader, xmlrpc, xmlwriter, xsl, Zend OPcache, zip, zlib + amqp, apcu, bcmath, bz2, calendar, Core, ctype, curl, date, dba, dom, enchant, exif, fileinfo, filter, ftp, gd, gettext, gmp, hash, iconv, igbinary, imagick, imap, interbase, intl, json, ldap, libxml, mbstring, mcrypt, memcache, memcached, mongodb, msgpack, mysqli, mysqlnd, openssl, pcntl, pcre, PDO, pdo_dblib, PDO_Firebird, pdo_mysql, pdo_pgsql, pdo_sqlite, pdo_sqlsrv, pgsql, phalcon, Phar, posix, pspell, rdkafka, readline, recode, redis, Reflection, session, shmop, SimpleXML, snmp, soap, sockets, SPL, sqlite3, sqlsrv, standard, swoole, sysvmsg, sysvsem, sysvshm, tidy, tokenizer, uploadprogress, wddx, xdebug, xml, xmlreader, xmlrpc, xmlwriter, xsl, Zend OPcache, zip, zlib 7.2 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 - amqp, apcu, bcmath, bz2, calendar, Core, ctype, curl, date, dba, dom, enchant, exif, fileinfo, filter, ftp, gd, gettext, gmp, hash, iconv, igbinary, imagick, imap, interbase, intl, json, ldap, libxml, mbstring, mcrypt, memcache, memcached, mongodb, msgpack, mysqli, mysqlnd, openssl, pcntl, pcre, PDO, pdo_dblib, PDO_Firebird, pdo_mysql, pdo_pgsql, pdo_sqlite, pgsql, phalcon, 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, xdebug, xml, xmlreader, xmlrpc, xmlwriter, xsl, Zend OPcache, zip, zlib + amqp, apcu, bcmath, bz2, calendar, Core, ctype, curl, date, dba, dom, enchant, exif, fileinfo, filter, ftp, gd, gettext, gmp, hash, iconv, igbinary, imagick, imap, interbase, intl, json, ldap, libxml, mbstring, mcrypt, memcache, memcached, mongodb, msgpack, mysqli, mysqlnd, openssl, pcntl, pcre, PDO, pdo_dblib, PDO_Firebird, pdo_mysql, pdo_pgsql, pdo_sqlite, pdo_sqlsrv, pgsql, phalcon, Phar, posix, pspell, rdkafka, readline, recode, redis, Reflection, session, shmop, SimpleXML, snmp, soap, sockets, sodium, SPL, sqlite3, sqlsrv, standard, swoole, sysvmsg, sysvsem, sysvshm, tidy, tokenizer, uploadprogress, wddx, xdebug, xml, xmlreader, xmlrpc, xmlwriter, xsl, Zend OPcache, zip, zlib 7.3 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 - apcu, bcmath, bz2, calendar, Core, ctype, curl, date, dba, dom, enchant, exif, fileinfo, filter, ftp, gd, gettext, gmp, hash, iconv, igbinary, imagick, 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, xdebug, xml, xmlreader, xmlrpc, xmlwriter, xsl, Zend OPcache, zip, zlib + apcu, bcmath, bz2, calendar, Core, ctype, curl, date, dba, dom, enchant, exif, fileinfo, filter, ftp, gd, gettext, gmp, hash, iconv, igbinary, imagick, 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, pdo_sqlsrv, pgsql, Phar, posix, pspell, rdkafka, readline, recode, redis, Reflection, session, shmop, SimpleXML, snmp, soap, sockets, sodium, SPL, sqlite3, sqlsrv, standard, swoole, sysvmsg, sysvsem, sysvshm, tidy, tokenizer, uploadprogress, wddx, xdebug, xml, xmlreader, xmlrpc, xmlwriter, xsl, Zend OPcache, zip, zlib 7.4 diff --git a/build/ansible/group_vars/all.yml b/build/ansible/group_vars/all.yml index f7fe3f30..e0ae5532 100644 --- a/build/ansible/group_vars/all.yml +++ b/build/ansible/group_vars/all.yml @@ -719,6 +719,7 @@ extensions_enabled: - pdo_odbc - pdo_pgsql - pdo_sqlite + - pdo_sqlsrv - pgsql - phalcon - phar @@ -737,6 +738,7 @@ extensions_enabled: - sockets - sodium - spl + - sqlsrv - swoole - sysvmsg - sysvsem @@ -1203,6 +1205,17 @@ extensions_available: all: type: builtin build_dep: [libsqlite3-dev] + pdo_sqlsrv: + disabled: [5.2, 5.3, 5.4, 5.5, 5.6, 7.4] + 7.3: + type: pecl + version: 5.5.0preview + build_dep: [unixodbc-dev] + run_dep: [unixodbc] + all: + type: pecl + build_dep: [unixodbc-dev] + run_dep: [unixodbc] pgsql: all: type: builtin @@ -1325,6 +1338,17 @@ extensions_available: build_dep: [libsodium-dev] spl: disabled: "{{ php_all_versions }}" # TODO: Did not work + sqlsrv: + disabled: [5.2, 5.3, 5.4, 5.5, 5.6, 7.4] + 7.3: + type: pecl + version: 5.5.0preview + build_dep: [unixodbc-dev] + run_dep: [unixodbc] + all: + type: pecl + build_dep: [unixodbc-dev] + run_dep: [unixodbc] swoole: disabled: [5.2] 5.3: