From 25701b18909174bdda0badc653f640e7265f34c2 Mon Sep 17 00:00:00 2001 From: "Shao Yu-Lung (Allen)" Date: Sun, 28 Mar 2021 11:18:39 +0800 Subject: [PATCH] php 5.6 skip install deciman extension --- php-fpm/Dockerfile | 12 ++++++++---- workspace/Dockerfile | 15 +++++++++------ 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/php-fpm/Dockerfile b/php-fpm/Dockerfile index 9ee8460f..46420241 100644 --- a/php-fpm/Dockerfile +++ b/php-fpm/Dockerfile @@ -1078,10 +1078,14 @@ USER root ARG INSTALL_PHPDECIMAL=false RUN if [ ${INSTALL_PHPDECIMAL} = true ]; then \ - apt-get update -yqq \ - && apt-get install -y libmpdec-dev \ - && pecl install decimal \ - && docker-php-ext-enable decimal \ + if [ $(php -r "echo PHP_MAJOR_VERSION;") = "5" ]; then \ + echo 'decimal not support PHP 5.6'; \ + else \ + apt-get install -yqq libmpdec-dev \ + && pecl install decimal \ + && docker-php-ext-enable decimal \ + && php -m | grep -q 'decimal' \ + ;fi \ ;fi ########################################################################### diff --git a/workspace/Dockerfile b/workspace/Dockerfile index 7ef997b3..85fd25d2 100644 --- a/workspace/Dockerfile +++ b/workspace/Dockerfile @@ -1588,12 +1588,15 @@ USER root ARG INSTALL_PHPDECIMAL=false RUN if [ ${INSTALL_PHPDECIMAL} = true ]; then \ - apt-get update -yqq \ - && apt-get install -y libmpdec-dev \ - && pecl install decimal \ - && echo "extension=decimal.so" >> /etc/php/${LARADOCK_PHP_VERSION}/mods-available/decimal.ini \ - && ln -s /etc/php/${LARADOCK_PHP_VERSION}/mods-available/decimal.ini /etc/php/${LARADOCK_PHP_VERSION}/cli/conf.d/30-decimal.ini \ - && php -m | grep -q 'decimal' \ + if [ $(php -r "echo PHP_MAJOR_VERSION;") = "5" ]; then \ + echo 'decimal not support PHP 5.6'; \ + else \ + apt-get install -yqq libmpdec-dev \ + && pecl install decimal \ + && echo "extension=decimal.so" >> /etc/php/${LARADOCK_PHP_VERSION}/mods-available/decimal.ini \ + && ln -s /etc/php/${LARADOCK_PHP_VERSION}/mods-available/decimal.ini /etc/php/${LARADOCK_PHP_VERSION}/cli/conf.d/30-decimal.ini \ + && php -m | grep -q 'decimal' \ + ;fi \ ;fi #