diff --git a/php-fpm/Dockerfile b/php-fpm/Dockerfile index 22c3a30..be2ab84 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 67c3677..feccf6a 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' \