From 176d4e8033cacada690c0632b6314495e40ef6aa Mon Sep 17 00:00:00 2001 From: "Shao Yu-Lung (Allen)" Date: Fri, 22 Feb 2019 23:45:21 +0800 Subject: [PATCH] php 7.0 php-fpm and workspace PECL install sqlsrv pdo_sqlsrv specify 5.3.0 version. (#2010) --- php-fpm/Dockerfile | 6 +++++- workspace/Dockerfile | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/php-fpm/Dockerfile b/php-fpm/Dockerfile index 22c3a308..be2ab846 100644 --- a/php-fpm/Dockerfile +++ b/php-fpm/Dockerfile @@ -477,7 +477,11 @@ RUN set -eux; if [ ${INSTALL_MSSQL} = true ]; then \ && ln -sfn /etc/locale.alias /usr/share/locale/locale.alias \ && locale-gen \ # Install pdo_sqlsrv and sqlsrv from PECL. Replace pdo_sqlsrv-4.1.8preview with preferred version. - && pecl install pdo_sqlsrv sqlsrv \ + && if [ $(php -r "echo PHP_MINOR_VERSION;") = "0" ]; then \ + pecl install pdo_sqlsrv-5.3.0 sqlsrv-5.3.0 \ + ;else \ + pecl install pdo_sqlsrv sqlsrv \ + ;fi \ && docker-php-ext-enable pdo_sqlsrv sqlsrv \ && php -m | grep -q 'pdo_sqlsrv' \ && php -m | grep -q 'sqlsrv' \ diff --git a/workspace/Dockerfile b/workspace/Dockerfile index 67c3677d..feccf6a1 100644 --- a/workspace/Dockerfile +++ b/workspace/Dockerfile @@ -746,7 +746,11 @@ RUN set -eux; if [ ${INSTALL_MSSQL} = true ]; then \ ln -sfn /opt/mssql-tools/bin/bcp /usr/bin/bcp && \ echo "en_US.UTF-8 UTF-8" > /etc/locale.gen && \ locale-gen && \ - pecl install sqlsrv pdo_sqlsrv && \ + if [ $(php -r "echo PHP_MINOR_VERSION;") = "0" ]; then \ + pecl install sqlsrv-5.3.0 pdo_sqlsrv-5.3.0 \ + ;else \ + pecl install sqlsrv pdo_sqlsrv \ + ;fi && \ echo "extension=sqlsrv.so" > /etc/php/${LARADOCK_PHP_VERSION}/cli/conf.d/20-sqlsrv.ini && \ echo "extension=pdo_sqlsrv.so" > /etc/php/${LARADOCK_PHP_VERSION}/cli/conf.d/20-pdo_sqlsrv.ini \ && php -m | grep -q 'sqlsrv' \