fix: 解决 PHP 安装部分依赖失败的问题

This commit is contained in:
zhengkunwang223 2023-10-26 11:01:27 +08:00
parent 5a7f4ea31d
commit d48bcd1253
59 changed files with 182 additions and 179 deletions

View File

@ -20,8 +20,16 @@ if [[ "$RUN_INSTALL" -eq "1" ]]; then
fi fi
if [[ "$PACKAGE_MANAGER" == "npm" ]]; then if [[ "$CUSTOM_SCRIPT" -eq "1" ]]; then
npm run $EXEC_SCRIPT $EXEC_SCRIPT
elif [[ "$PACKAGE_MANAGER" == "yarn" ]]; then else
yarn run $EXEC_SCRIPT if [[ "$PACKAGE_MANAGER" == "npm" ]]; then
npm run $EXEC_SCRIPT
elif [[ "$PACKAGE_MANAGER" == "yarn" ]]; then
yarn run $EXEC_SCRIPT
fi
fi fi

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -60,36 +60,17 @@ isPhpVersionGreaterOrEqual()
installExtensionFromTgz() installExtensionFromTgz()
{ {
tgzName=$1 tgzName=$1
para1= result=""
extensionName="${tgzName%%-*}" extensionName="${tgzName%%-*}"
shift 1
if [ $2 ]; then result=$@
para1=$2
fi
mkdir ${extensionName} mkdir ${extensionName}
tar -xf ${tgzName}.tgz -C ${extensionName} --strip-components=1 tar -xf ${tgzName}.tgz -C ${extensionName} --strip-components=1
( cd ${extensionName} && phpize && ./configure ${para1} && make ${MC} && make install ) ( cd ${extensionName} && phpize && ./configure ${result} && make ${MC} && make install )
docker-php-ext-enable ${extensionName} docker-php-ext-enable ${extensionName}
} }
# install use install-php-extensions
if [[ -z "${EXTENSIONS##*,ioncube_loader,*}" ]]; then
echo "---------- Install ioncube_loader ----------"
install-php-extensions ioncube_loader
fi
if [[ -z "${EXTENSIONS##*,imagick,*}" ]]; then
echo "---------- Install imagick ----------"
install-php-extensions imagick
fi
if [[ -z "${EXTENSIONS##*,sourceguardian,*}" ]]; then
echo "---------- Install sourceguardian ----------"
install-php-extensions sourceguardian
fi
# end
if [[ -z "${EXTENSIONS##*,pdo_mysql,*}" ]]; then if [[ -z "${EXTENSIONS##*,pdo_mysql,*}" ]]; then
echo "---------- Install pdo_mysql ----------" echo "---------- Install pdo_mysql ----------"
@ -469,11 +450,29 @@ if [[ -z "${EXTENSIONS##*,varnish,*}" ]]; then
fi fi
if [[ -z "${EXTENSIONS##*,pdo_sqlsrv,*}" ]]; then if [[ -z "${EXTENSIONS##*,pdo_sqlsrv,*}" ]]; then
install-php-extensions pdo_sqlsrv isPhpVersionGreaterOrEqual 7 1
if [[ "$?" = "1" ]]; then
echo "---------- Install pdo_sqlsrv ----------"
apk add --no-cache unixodbc-dev
printf "\n" | pecl install pdo_sqlsrv
docker-php-ext-enable pdo_sqlsrv
curl -o /tmp/msodbcsql17_amd64.apk https://download.microsoft.com/download/e/4/e/e4e67866-dffd-428c-aac7-8d28ddafb39b/msodbcsql17_17.5.2.1-1_amd64.apk
apk add --allow-untrusted /tmp/msodbcsql17_amd64.apk
else
echo "pdo_sqlsrv requires PHP >= 7.1.0, installed version is ${PHP_VERSION}"
fi
fi fi
if [[ -z "${EXTENSIONS##*,sqlsrv,*}" ]]; then if [[ -z "${EXTENSIONS##*,sqlsrv,*}" ]]; then
install-php-extensions sqlsrv isPhpVersionGreaterOrEqual 7 1
if [[ "$?" = "1" ]]; then
echo "---------- Install sqlsrv ----------"
apk add --no-cache unixodbc-dev
printf "\n" | pecl install sqlsrv
docker-php-ext-enable sqlsrv
else
echo "pdo_sqlsrv requires PHP >= 7.1.0, installed version is ${PHP_VERSION}"
fi
fi fi
if [[ -z "${EXTENSIONS##*,mcrypt,*}" ]]; then if [[ -z "${EXTENSIONS##*,mcrypt,*}" ]]; then
@ -522,13 +521,7 @@ fi
if [[ -z "${EXTENSIONS##*,redis,*}" ]]; then if [[ -z "${EXTENSIONS##*,redis,*}" ]]; then
echo "---------- Install redis ----------" echo "---------- Install redis ----------"
isPhpVersionGreaterOrEqual 7 0 installExtensionFromTgz redis-5.3.7
if [[ "$?" = "1" ]]; then
installExtensionFromTgz redis-5.2.2
else
printf "\n" | pecl install redis-4.3.0
docker-php-ext-enable redis
fi
fi fi
if [[ -z "${EXTENSIONS##*,apcu,*}" ]]; then if [[ -z "${EXTENSIONS##*,apcu,*}" ]]; then
@ -587,12 +580,18 @@ if [[ -z "${EXTENSIONS##*,event,*}" ]]; then
fi fi
echo "---------- Install event again ----------" echo "---------- Install event again ----------"
installExtensionFromTgz event-2.5.6 "--ini-name event.ini" mkdir event
tar -xf event-3.0.8.tgz -C event --strip-components=1
cd event && phpize && ./configure && make && make install
docker-php-ext-enable --ini-name event.ini event
fi fi
if [[ -z "${EXTENSIONS##*,mongodb,*}" ]]; then if [[ -z "${EXTENSIONS##*,mongodb,*}" ]]; then
echo "---------- Install mongodb ----------" echo "---------- Install mongodb ----------"
apk add --no-cache openssl-dev
installExtensionFromTgz mongodb-1.7.4 installExtensionFromTgz mongodb-1.7.4
docker-php-ext-configure mongodb --with-mongodb-ssl=openssl
fi fi
if [[ -z "${EXTENSIONS##*,yaf,*}" ]]; then if [[ -z "${EXTENSIONS##*,yaf,*}" ]]; then
@ -616,7 +615,7 @@ if [[ -z "${EXTENSIONS##*,swoole,*}" ]]; then
isPhpVersionGreaterOrEqual 7 0 isPhpVersionGreaterOrEqual 7 0
if [[ "$?" = "1" ]]; then if [[ "$?" = "1" ]]; then
installExtensionFromTgz swoole-4.5.2 installExtensionFromTgz swoole-4.8.11 --enable-openssl
else else
installExtensionFromTgz swoole-2.0.11 installExtensionFromTgz swoole-2.0.11
fi fi

Binary file not shown.

Binary file not shown.

View File

@ -60,36 +60,17 @@ isPhpVersionGreaterOrEqual()
installExtensionFromTgz() installExtensionFromTgz()
{ {
tgzName=$1 tgzName=$1
para1= result=""
extensionName="${tgzName%%-*}" extensionName="${tgzName%%-*}"
shift 1
if [ $2 ]; then result=$@
para1=$2
fi
mkdir ${extensionName} mkdir ${extensionName}
tar -xf ${tgzName}.tgz -C ${extensionName} --strip-components=1 tar -xf ${tgzName}.tgz -C ${extensionName} --strip-components=1
( cd ${extensionName} && phpize && ./configure ${para1} && make ${MC} && make install ) ( cd ${extensionName} && phpize && ./configure ${result} && make ${MC} && make install )
docker-php-ext-enable ${extensionName} docker-php-ext-enable ${extensionName}
} }
# install use install-php-extensions
if [[ -z "${EXTENSIONS##*,ioncube_loader,*}" ]]; then
echo "---------- Install ioncube_loader ----------"
install-php-extensions ioncube_loader
fi
if [[ -z "${EXTENSIONS##*,imagick,*}" ]]; then
echo "---------- Install imagick ----------"
install-php-extensions imagick
fi
if [[ -z "${EXTENSIONS##*,sourceguardian,*}" ]]; then
echo "---------- Install sourceguardian ----------"
install-php-extensions sourceguardian
fi
# end
if [[ -z "${EXTENSIONS##*,pdo_mysql,*}" ]]; then if [[ -z "${EXTENSIONS##*,pdo_mysql,*}" ]]; then
echo "---------- Install pdo_mysql ----------" echo "---------- Install pdo_mysql ----------"
@ -469,11 +450,29 @@ if [[ -z "${EXTENSIONS##*,varnish,*}" ]]; then
fi fi
if [[ -z "${EXTENSIONS##*,pdo_sqlsrv,*}" ]]; then if [[ -z "${EXTENSIONS##*,pdo_sqlsrv,*}" ]]; then
install-php-extensions pdo_sqlsrv isPhpVersionGreaterOrEqual 7 1
if [[ "$?" = "1" ]]; then
echo "---------- Install pdo_sqlsrv ----------"
apk add --no-cache unixodbc-dev
printf "\n" | pecl install pdo_sqlsrv
docker-php-ext-enable pdo_sqlsrv
curl -o /tmp/msodbcsql17_amd64.apk https://download.microsoft.com/download/e/4/e/e4e67866-dffd-428c-aac7-8d28ddafb39b/msodbcsql17_17.5.2.1-1_amd64.apk
apk add --allow-untrusted /tmp/msodbcsql17_amd64.apk
else
echo "pdo_sqlsrv requires PHP >= 7.1.0, installed version is ${PHP_VERSION}"
fi
fi fi
if [[ -z "${EXTENSIONS##*,sqlsrv,*}" ]]; then if [[ -z "${EXTENSIONS##*,sqlsrv,*}" ]]; then
install-php-extensions sqlsrv isPhpVersionGreaterOrEqual 7 1
if [[ "$?" = "1" ]]; then
echo "---------- Install sqlsrv ----------"
apk add --no-cache unixodbc-dev
printf "\n" | pecl install sqlsrv
docker-php-ext-enable sqlsrv
else
echo "pdo_sqlsrv requires PHP >= 7.1.0, installed version is ${PHP_VERSION}"
fi
fi fi
if [[ -z "${EXTENSIONS##*,mcrypt,*}" ]]; then if [[ -z "${EXTENSIONS##*,mcrypt,*}" ]]; then
@ -522,13 +521,7 @@ fi
if [[ -z "${EXTENSIONS##*,redis,*}" ]]; then if [[ -z "${EXTENSIONS##*,redis,*}" ]]; then
echo "---------- Install redis ----------" echo "---------- Install redis ----------"
isPhpVersionGreaterOrEqual 7 0 installExtensionFromTgz redis-5.3.7
if [[ "$?" = "1" ]]; then
installExtensionFromTgz redis-5.2.2
else
printf "\n" | pecl install redis-4.3.0
docker-php-ext-enable redis
fi
fi fi
if [[ -z "${EXTENSIONS##*,apcu,*}" ]]; then if [[ -z "${EXTENSIONS##*,apcu,*}" ]]; then
@ -587,12 +580,18 @@ if [[ -z "${EXTENSIONS##*,event,*}" ]]; then
fi fi
echo "---------- Install event again ----------" echo "---------- Install event again ----------"
installExtensionFromTgz event-2.5.6 "--ini-name event.ini" mkdir event
tar -xf event-3.0.8.tgz -C event --strip-components=1
cd event && phpize && ./configure && make && make install
docker-php-ext-enable --ini-name event.ini event
fi fi
if [[ -z "${EXTENSIONS##*,mongodb,*}" ]]; then if [[ -z "${EXTENSIONS##*,mongodb,*}" ]]; then
echo "---------- Install mongodb ----------" echo "---------- Install mongodb ----------"
apk add --no-cache openssl-dev
installExtensionFromTgz mongodb-1.7.4 installExtensionFromTgz mongodb-1.7.4
docker-php-ext-configure mongodb --with-mongodb-ssl=openssl
fi fi
if [[ -z "${EXTENSIONS##*,yaf,*}" ]]; then if [[ -z "${EXTENSIONS##*,yaf,*}" ]]; then
@ -616,7 +615,7 @@ if [[ -z "${EXTENSIONS##*,swoole,*}" ]]; then
isPhpVersionGreaterOrEqual 7 0 isPhpVersionGreaterOrEqual 7 0
if [[ "$?" = "1" ]]; then if [[ "$?" = "1" ]]; then
installExtensionFromTgz swoole-4.5.2 installExtensionFromTgz swoole-4.8.11 --enable-openssl
else else
installExtensionFromTgz swoole-2.0.11 installExtensionFromTgz swoole-2.0.11
fi fi

Binary file not shown.

Binary file not shown.

View File

@ -60,36 +60,17 @@ isPhpVersionGreaterOrEqual()
installExtensionFromTgz() installExtensionFromTgz()
{ {
tgzName=$1 tgzName=$1
para1= result=""
extensionName="${tgzName%%-*}" extensionName="${tgzName%%-*}"
shift 1
if [ $2 ]; then result=$@
para1=$2
fi
mkdir ${extensionName} mkdir ${extensionName}
tar -xf ${tgzName}.tgz -C ${extensionName} --strip-components=1 tar -xf ${tgzName}.tgz -C ${extensionName} --strip-components=1
( cd ${extensionName} && phpize && ./configure ${para1} && make ${MC} && make install ) ( cd ${extensionName} && phpize && ./configure ${result} && make ${MC} && make install )
docker-php-ext-enable ${extensionName} docker-php-ext-enable ${extensionName}
} }
# install use install-php-extensions
if [[ -z "${EXTENSIONS##*,ioncube_loader,*}" ]]; then
echo "---------- Install ioncube_loader ----------"
install-php-extensions ioncube_loader
fi
if [[ -z "${EXTENSIONS##*,imagick,*}" ]]; then
echo "---------- Install imagick ----------"
install-php-extensions imagick
fi
if [[ -z "${EXTENSIONS##*,sourceguardian,*}" ]]; then
echo "---------- Install sourceguardian ----------"
install-php-extensions sourceguardian
fi
# end
if [[ -z "${EXTENSIONS##*,pdo_mysql,*}" ]]; then if [[ -z "${EXTENSIONS##*,pdo_mysql,*}" ]]; then
echo "---------- Install pdo_mysql ----------" echo "---------- Install pdo_mysql ----------"
@ -469,11 +450,29 @@ if [[ -z "${EXTENSIONS##*,varnish,*}" ]]; then
fi fi
if [[ -z "${EXTENSIONS##*,pdo_sqlsrv,*}" ]]; then if [[ -z "${EXTENSIONS##*,pdo_sqlsrv,*}" ]]; then
install-php-extensions pdo_sqlsrv isPhpVersionGreaterOrEqual 7 1
if [[ "$?" = "1" ]]; then
echo "---------- Install pdo_sqlsrv ----------"
apk add --no-cache unixodbc-dev
printf "\n" | pecl install pdo_sqlsrv
docker-php-ext-enable pdo_sqlsrv
curl -o /tmp/msodbcsql17_amd64.apk https://download.microsoft.com/download/e/4/e/e4e67866-dffd-428c-aac7-8d28ddafb39b/msodbcsql17_17.5.2.1-1_amd64.apk
apk add --allow-untrusted /tmp/msodbcsql17_amd64.apk
else
echo "pdo_sqlsrv requires PHP >= 7.1.0, installed version is ${PHP_VERSION}"
fi
fi fi
if [[ -z "${EXTENSIONS##*,sqlsrv,*}" ]]; then if [[ -z "${EXTENSIONS##*,sqlsrv,*}" ]]; then
install-php-extensions sqlsrv isPhpVersionGreaterOrEqual 7 1
if [[ "$?" = "1" ]]; then
echo "---------- Install sqlsrv ----------"
apk add --no-cache unixodbc-dev
printf "\n" | pecl install sqlsrv
docker-php-ext-enable sqlsrv
else
echo "pdo_sqlsrv requires PHP >= 7.1.0, installed version is ${PHP_VERSION}"
fi
fi fi
if [[ -z "${EXTENSIONS##*,mcrypt,*}" ]]; then if [[ -z "${EXTENSIONS##*,mcrypt,*}" ]]; then
@ -522,13 +521,7 @@ fi
if [[ -z "${EXTENSIONS##*,redis,*}" ]]; then if [[ -z "${EXTENSIONS##*,redis,*}" ]]; then
echo "---------- Install redis ----------" echo "---------- Install redis ----------"
isPhpVersionGreaterOrEqual 7 0 installExtensionFromTgz redis-5.3.7
if [[ "$?" = "1" ]]; then
installExtensionFromTgz redis-5.2.2
else
printf "\n" | pecl install redis-4.3.0
docker-php-ext-enable redis
fi
fi fi
if [[ -z "${EXTENSIONS##*,apcu,*}" ]]; then if [[ -z "${EXTENSIONS##*,apcu,*}" ]]; then
@ -587,12 +580,18 @@ if [[ -z "${EXTENSIONS##*,event,*}" ]]; then
fi fi
echo "---------- Install event again ----------" echo "---------- Install event again ----------"
installExtensionFromTgz event-2.5.6 "--ini-name event.ini" mkdir event
tar -xf event-3.0.8.tgz -C event --strip-components=1
cd event && phpize && ./configure && make && make install
docker-php-ext-enable --ini-name event.ini event
fi fi
if [[ -z "${EXTENSIONS##*,mongodb,*}" ]]; then if [[ -z "${EXTENSIONS##*,mongodb,*}" ]]; then
echo "---------- Install mongodb ----------" echo "---------- Install mongodb ----------"
apk add --no-cache openssl-dev
installExtensionFromTgz mongodb-1.7.4 installExtensionFromTgz mongodb-1.7.4
docker-php-ext-configure mongodb --with-mongodb-ssl=openssl
fi fi
if [[ -z "${EXTENSIONS##*,yaf,*}" ]]; then if [[ -z "${EXTENSIONS##*,yaf,*}" ]]; then
@ -616,7 +615,7 @@ if [[ -z "${EXTENSIONS##*,swoole,*}" ]]; then
isPhpVersionGreaterOrEqual 7 0 isPhpVersionGreaterOrEqual 7 0
if [[ "$?" = "1" ]]; then if [[ "$?" = "1" ]]; then
installExtensionFromTgz swoole-4.5.2 installExtensionFromTgz swoole-4.8.11 --enable-openssl
else else
installExtensionFromTgz swoole-2.0.11 installExtensionFromTgz swoole-2.0.11
fi fi

Binary file not shown.

Binary file not shown.

View File

@ -60,36 +60,17 @@ isPhpVersionGreaterOrEqual()
installExtensionFromTgz() installExtensionFromTgz()
{ {
tgzName=$1 tgzName=$1
para1= result=""
extensionName="${tgzName%%-*}" extensionName="${tgzName%%-*}"
shift 1
if [ $2 ]; then result=$@
para1=$2
fi
mkdir ${extensionName} mkdir ${extensionName}
tar -xf ${tgzName}.tgz -C ${extensionName} --strip-components=1 tar -xf ${tgzName}.tgz -C ${extensionName} --strip-components=1
( cd ${extensionName} && phpize && ./configure ${para1} && make ${MC} && make install ) ( cd ${extensionName} && phpize && ./configure ${result} && make ${MC} && make install )
docker-php-ext-enable ${extensionName} docker-php-ext-enable ${extensionName}
} }
# install use install-php-extensions
if [[ -z "${EXTENSIONS##*,ioncube_loader,*}" ]]; then
echo "---------- Install ioncube_loader ----------"
install-php-extensions ioncube_loader
fi
if [[ -z "${EXTENSIONS##*,imagick,*}" ]]; then
echo "---------- Install imagick ----------"
install-php-extensions imagick
fi
if [[ -z "${EXTENSIONS##*,sourceguardian,*}" ]]; then
echo "---------- Install sourceguardian ----------"
install-php-extensions sourceguardian
fi
# end
if [[ -z "${EXTENSIONS##*,pdo_mysql,*}" ]]; then if [[ -z "${EXTENSIONS##*,pdo_mysql,*}" ]]; then
echo "---------- Install pdo_mysql ----------" echo "---------- Install pdo_mysql ----------"
@ -469,11 +450,29 @@ if [[ -z "${EXTENSIONS##*,varnish,*}" ]]; then
fi fi
if [[ -z "${EXTENSIONS##*,pdo_sqlsrv,*}" ]]; then if [[ -z "${EXTENSIONS##*,pdo_sqlsrv,*}" ]]; then
install-php-extensions pdo_sqlsrv isPhpVersionGreaterOrEqual 7 1
if [[ "$?" = "1" ]]; then
echo "---------- Install pdo_sqlsrv ----------"
apk add --no-cache unixodbc-dev
printf "\n" | pecl install pdo_sqlsrv
docker-php-ext-enable pdo_sqlsrv
curl -o /tmp/msodbcsql17_amd64.apk https://download.microsoft.com/download/e/4/e/e4e67866-dffd-428c-aac7-8d28ddafb39b/msodbcsql17_17.5.2.1-1_amd64.apk
apk add --allow-untrusted /tmp/msodbcsql17_amd64.apk
else
echo "pdo_sqlsrv requires PHP >= 7.1.0, installed version is ${PHP_VERSION}"
fi
fi fi
if [[ -z "${EXTENSIONS##*,sqlsrv,*}" ]]; then if [[ -z "${EXTENSIONS##*,sqlsrv,*}" ]]; then
install-php-extensions sqlsrv isPhpVersionGreaterOrEqual 7 1
if [[ "$?" = "1" ]]; then
echo "---------- Install sqlsrv ----------"
apk add --no-cache unixodbc-dev
printf "\n" | pecl install sqlsrv
docker-php-ext-enable sqlsrv
else
echo "pdo_sqlsrv requires PHP >= 7.1.0, installed version is ${PHP_VERSION}"
fi
fi fi
if [[ -z "${EXTENSIONS##*,mcrypt,*}" ]]; then if [[ -z "${EXTENSIONS##*,mcrypt,*}" ]]; then
@ -522,13 +521,7 @@ fi
if [[ -z "${EXTENSIONS##*,redis,*}" ]]; then if [[ -z "${EXTENSIONS##*,redis,*}" ]]; then
echo "---------- Install redis ----------" echo "---------- Install redis ----------"
isPhpVersionGreaterOrEqual 7 0 installExtensionFromTgz redis-5.3.7
if [[ "$?" = "1" ]]; then
installExtensionFromTgz redis-5.2.2
else
printf "\n" | pecl install redis-4.3.0
docker-php-ext-enable redis
fi
fi fi
if [[ -z "${EXTENSIONS##*,apcu,*}" ]]; then if [[ -z "${EXTENSIONS##*,apcu,*}" ]]; then
@ -587,12 +580,18 @@ if [[ -z "${EXTENSIONS##*,event,*}" ]]; then
fi fi
echo "---------- Install event again ----------" echo "---------- Install event again ----------"
installExtensionFromTgz event-2.5.6 "--ini-name event.ini" mkdir event
tar -xf event-3.0.8.tgz -C event --strip-components=1
cd event && phpize && ./configure && make && make install
docker-php-ext-enable --ini-name event.ini event
fi fi
if [[ -z "${EXTENSIONS##*,mongodb,*}" ]]; then if [[ -z "${EXTENSIONS##*,mongodb,*}" ]]; then
echo "---------- Install mongodb ----------" echo "---------- Install mongodb ----------"
apk add --no-cache openssl-dev
installExtensionFromTgz mongodb-1.7.4 installExtensionFromTgz mongodb-1.7.4
docker-php-ext-configure mongodb --with-mongodb-ssl=openssl
fi fi
if [[ -z "${EXTENSIONS##*,yaf,*}" ]]; then if [[ -z "${EXTENSIONS##*,yaf,*}" ]]; then
@ -616,7 +615,7 @@ if [[ -z "${EXTENSIONS##*,swoole,*}" ]]; then
isPhpVersionGreaterOrEqual 7 0 isPhpVersionGreaterOrEqual 7 0
if [[ "$?" = "1" ]]; then if [[ "$?" = "1" ]]; then
installExtensionFromTgz swoole-4.5.2 installExtensionFromTgz swoole-4.8.11 --enable-openssl
else else
installExtensionFromTgz swoole-2.0.11 installExtensionFromTgz swoole-2.0.11
fi fi

Binary file not shown.

Binary file not shown.

View File

@ -60,36 +60,17 @@ isPhpVersionGreaterOrEqual()
installExtensionFromTgz() installExtensionFromTgz()
{ {
tgzName=$1 tgzName=$1
para1= result=""
extensionName="${tgzName%%-*}" extensionName="${tgzName%%-*}"
shift 1
if [ $2 ]; then result=$@
para1=$2
fi
mkdir ${extensionName} mkdir ${extensionName}
tar -xf ${tgzName}.tgz -C ${extensionName} --strip-components=1 tar -xf ${tgzName}.tgz -C ${extensionName} --strip-components=1
( cd ${extensionName} && phpize && ./configure ${para1} && make ${MC} && make install ) ( cd ${extensionName} && phpize && ./configure ${result} && make ${MC} && make install )
docker-php-ext-enable ${extensionName} docker-php-ext-enable ${extensionName}
} }
# install use install-php-extensions
if [[ -z "${EXTENSIONS##*,ioncube_loader,*}" ]]; then
echo "---------- Install ioncube_loader ----------"
install-php-extensions ioncube_loader
fi
if [[ -z "${EXTENSIONS##*,imagick,*}" ]]; then
echo "---------- Install imagick ----------"
install-php-extensions imagick
fi
if [[ -z "${EXTENSIONS##*,sourceguardian,*}" ]]; then
echo "---------- Install sourceguardian ----------"
install-php-extensions sourceguardian
fi
# end
if [[ -z "${EXTENSIONS##*,pdo_mysql,*}" ]]; then if [[ -z "${EXTENSIONS##*,pdo_mysql,*}" ]]; then
echo "---------- Install pdo_mysql ----------" echo "---------- Install pdo_mysql ----------"
@ -469,11 +450,29 @@ if [[ -z "${EXTENSIONS##*,varnish,*}" ]]; then
fi fi
if [[ -z "${EXTENSIONS##*,pdo_sqlsrv,*}" ]]; then if [[ -z "${EXTENSIONS##*,pdo_sqlsrv,*}" ]]; then
install-php-extensions pdo_sqlsrv isPhpVersionGreaterOrEqual 7 1
if [[ "$?" = "1" ]]; then
echo "---------- Install pdo_sqlsrv ----------"
apk add --no-cache unixodbc-dev
printf "\n" | pecl install pdo_sqlsrv
docker-php-ext-enable pdo_sqlsrv
curl -o /tmp/msodbcsql17_amd64.apk https://download.microsoft.com/download/e/4/e/e4e67866-dffd-428c-aac7-8d28ddafb39b/msodbcsql17_17.5.2.1-1_amd64.apk
apk add --allow-untrusted /tmp/msodbcsql17_amd64.apk
else
echo "pdo_sqlsrv requires PHP >= 7.1.0, installed version is ${PHP_VERSION}"
fi
fi fi
if [[ -z "${EXTENSIONS##*,sqlsrv,*}" ]]; then if [[ -z "${EXTENSIONS##*,sqlsrv,*}" ]]; then
install-php-extensions sqlsrv isPhpVersionGreaterOrEqual 7 1
if [[ "$?" = "1" ]]; then
echo "---------- Install sqlsrv ----------"
apk add --no-cache unixodbc-dev
printf "\n" | pecl install sqlsrv
docker-php-ext-enable sqlsrv
else
echo "pdo_sqlsrv requires PHP >= 7.1.0, installed version is ${PHP_VERSION}"
fi
fi fi
if [[ -z "${EXTENSIONS##*,mcrypt,*}" ]]; then if [[ -z "${EXTENSIONS##*,mcrypt,*}" ]]; then
@ -522,13 +521,7 @@ fi
if [[ -z "${EXTENSIONS##*,redis,*}" ]]; then if [[ -z "${EXTENSIONS##*,redis,*}" ]]; then
echo "---------- Install redis ----------" echo "---------- Install redis ----------"
isPhpVersionGreaterOrEqual 7 0 installExtensionFromTgz redis-5.3.7
if [[ "$?" = "1" ]]; then
installExtensionFromTgz redis-5.2.2
else
printf "\n" | pecl install redis-4.3.0
docker-php-ext-enable redis
fi
fi fi
if [[ -z "${EXTENSIONS##*,apcu,*}" ]]; then if [[ -z "${EXTENSIONS##*,apcu,*}" ]]; then
@ -587,12 +580,18 @@ if [[ -z "${EXTENSIONS##*,event,*}" ]]; then
fi fi
echo "---------- Install event again ----------" echo "---------- Install event again ----------"
installExtensionFromTgz event-2.5.6 "--ini-name event.ini" mkdir event
tar -xf event-3.0.8.tgz -C event --strip-components=1
cd event && phpize && ./configure && make && make install
docker-php-ext-enable --ini-name event.ini event
fi fi
if [[ -z "${EXTENSIONS##*,mongodb,*}" ]]; then if [[ -z "${EXTENSIONS##*,mongodb,*}" ]]; then
echo "---------- Install mongodb ----------" echo "---------- Install mongodb ----------"
apk add --no-cache openssl-dev
installExtensionFromTgz mongodb-1.7.4 installExtensionFromTgz mongodb-1.7.4
docker-php-ext-configure mongodb --with-mongodb-ssl=openssl
fi fi
if [[ -z "${EXTENSIONS##*,yaf,*}" ]]; then if [[ -z "${EXTENSIONS##*,yaf,*}" ]]; then
@ -616,7 +615,7 @@ if [[ -z "${EXTENSIONS##*,swoole,*}" ]]; then
isPhpVersionGreaterOrEqual 7 0 isPhpVersionGreaterOrEqual 7 0
if [[ "$?" = "1" ]]; then if [[ "$?" = "1" ]]; then
installExtensionFromTgz swoole-4.5.2 installExtensionFromTgz swoole-4.8.11 --enable-openssl
else else
installExtensionFromTgz swoole-2.0.11 installExtensionFromTgz swoole-2.0.11
fi fi

Binary file not shown.