feat: 优化 PHP 7.x 的安装脚本 (#167)

This commit is contained in:
zhengkunwang223 2023-06-28 18:38:35 +08:00 committed by GitHub
parent ee10418f0e
commit 596d533708
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
58 changed files with 581 additions and 376 deletions

View File

@ -311,7 +311,7 @@ serialize_precision = -1
; This directive allows you to disable certain functions for security reasons.
; It receives a comma-delimited list of function names.
; http://php.net/disable-functions
disable_functions = passthru,exec,system,chroot,chgrp,chown,shell_exec,popen,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv
disable_functions =
; This directive allows you to disable certain classes for security reasons.
; It receives a comma-delimited list of class names.

View File

@ -311,7 +311,7 @@ serialize_precision = -1
; This directive allows you to disable certain functions for security reasons.
; It receives a comma-delimited list of function names.
; http://php.net/disable-functions
disable_functions = passthru,exec,system,chroot,chgrp,chown,shell_exec,popen,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv
disable_functions =
; This directive allows you to disable certain classes for security reasons.
; It receives a comma-delimited list of class names.

View File

@ -311,7 +311,7 @@ serialize_precision = -1
; This directive allows you to disable certain functions for security reasons.
; It receives a comma-delimited list of function names.
; http://php.net/disable-functions
disable_functions = passthru,exec,system,chroot,chgrp,chown,shell_exec,popen,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv
disable_functions =
; This directive allows you to disable certain classes for security reasons.
; It receives a comma-delimited list of class names.

View File

@ -27,9 +27,9 @@ export EXTENSIONS=",${PHP_EXTENSIONS},"
# specific version.
#
# For example, to check if current php is greater than or
# equal to PHP 8.0:
# equal to PHP 7.0:
#
# isPhpVersionGreaterOrEqual 8 0
# isPhpVersionGreaterOrEqual 7 0
#
# Param 1: Specific PHP Major version
# Param 2: Specific PHP Minor version
@ -62,6 +62,7 @@ installExtensionFromTgz()
tgzName=$1
para1=
extensionName="${tgzName%%-*}"
if [ $2 ]; then
para1=$2
fi
@ -72,6 +73,18 @@ installExtensionFromTgz()
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
# end
if [[ -z "${EXTENSIONS##*,pdo_mysql,*}" ]]; then
echo "---------- Install pdo_mysql ----------"
@ -208,19 +221,9 @@ if [[ -z "${EXTENSIONS##*,hprose,*}" ]]; then
docker-php-ext-enable hprose
fi
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##*,gd,*}" ]]; then
echo "---------- Install gd ----------"
isPhpVersionGreaterOrEqual 8 0
isPhpVersionGreaterOrEqual 7 4
if [[ "$?" = "1" ]]; then
# "--with-xxx-dir" was removed from php 7.4,
@ -389,47 +392,47 @@ fi
if [[ -z "${EXTENSIONS##*,ssh2,*}" ]]; then
isPhpVersionGreaterOrEqual 8 0
isPhpVersionGreaterOrEqual 7 0
if [[ "$?" = "1" ]]; then
echo "---------- Install ssh2 ----------"
printf "\n" | apk add libssh2-dev
pecl install ssh2-1.1.2
docker-php-ext-enable ssh2
else
echo "ssh2 requires PHP >= 8.0.0, installed version is ${PHP_VERSION}"
echo "ssh2 requires PHP >= 7.0.0, installed version is ${PHP_VERSION}"
fi
fi
if [[ -z "${EXTENSIONS##*,protobuf,*}" ]]; then
isPhpVersionGreaterOrEqual 8 0
isPhpVersionGreaterOrEqual 7 0
if [[ "$?" = "1" ]]; then
echo "---------- Install protobuf ----------"
printf "\n" | pecl install protobuf
docker-php-ext-enable protobuf
else
echo "yar requires PHP >= 8.0.0, installed version is ${PHP_VERSION}"
echo "yar requires PHP >= 7.0.0, installed version is ${PHP_VERSION}"
fi
fi
if [[ -z "${EXTENSIONS##*,yac,*}" ]]; then
isPhpVersionGreaterOrEqual 8 0
isPhpVersionGreaterOrEqual 7 0
if [[ "$?" = "1" ]]; then
echo "---------- Install yac ----------"
printf "\n" | pecl install yac-2.0.2
docker-php-ext-enable yac
else
echo "yar requires PHP >= 8.0.0, installed version is ${PHP_VERSION}"
echo "yar requires PHP >= 7.0.0, installed version is ${PHP_VERSION}"
fi
fi
if [[ -z "${EXTENSIONS##*,yar,*}" ]]; then
isPhpVersionGreaterOrEqual 8 0
isPhpVersionGreaterOrEqual 7 0
if [[ "$?" = "1" ]]; then
echo "---------- Install yar ----------"
printf "\n" | pecl install yar
docker-php-ext-enable yar
else
echo "yar requires PHP >= 8.0.0, installed version is ${PHP_VERSION}"
echo "yar requires PHP >= 7.0.0, installed version is ${PHP_VERSION}"
fi
fi
@ -437,13 +440,13 @@ fi
if [[ -z "${EXTENSIONS##*,yaconf,*}" ]]; then
isPhpVersionGreaterOrEqual 8 0
isPhpVersionGreaterOrEqual 7 0
if [[ "$?" = "1" ]]; then
echo "---------- Install yaconf ----------"
printf "\n" | pecl install yaconf
docker-php-ext-enable yaconf
else
echo "yar requires PHP >= 8.0.0, installed version is ${PHP_VERSION}"
echo "yar requires PHP >= 7.0.0, installed version is ${PHP_VERSION}"
fi
fi
@ -461,7 +464,7 @@ if [[ -z "${EXTENSIONS##*,varnish,*}" ]]; then
fi
if [[ -z "${EXTENSIONS##*,pdo_sqlsrv,*}" ]]; then
isPhpVersionGreaterOrEqual 8 0
isPhpVersionGreaterOrEqual 7 1
if [[ "$?" = "1" ]]; then
echo "---------- Install pdo_sqlsrv ----------"
apk add --no-cache unixodbc-dev
@ -470,24 +473,24 @@ if [[ -z "${EXTENSIONS##*,pdo_sqlsrv,*}" ]]; then
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 >= 8.0.0, installed version is ${PHP_VERSION}"
echo "pdo_sqlsrv requires PHP >= 7.1.0, installed version is ${PHP_VERSION}"
fi
fi
if [[ -z "${EXTENSIONS##*,sqlsrv,*}" ]]; then
isPhpVersionGreaterOrEqual 8 0
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 >= 8.0.0, installed version is ${PHP_VERSION}"
echo "pdo_sqlsrv requires PHP >= 7.1.0, installed version is ${PHP_VERSION}"
fi
fi
if [[ -z "${EXTENSIONS##*,mcrypt,*}" ]]; then
isPhpVersionGreaterOrEqual 8 0
isPhpVersionGreaterOrEqual 7 0
if [[ "$?" = "1" ]]; then
echo "---------- Install mcrypt ----------"
apk add --no-cache libmcrypt-dev libmcrypt re2c
@ -501,10 +504,10 @@ if [[ -z "${EXTENSIONS##*,mcrypt,*}" ]]; then
fi
if [[ -z "${EXTENSIONS##*,mysql,*}" ]]; then
isPhpVersionGreaterOrEqual 8 0
isPhpVersionGreaterOrEqual 7 0
if [[ "$?" = "1" ]]; then
echo "---------- mysql was REMOVED from PHP 8.0.0 ----------"
echo "---------- mysql was REMOVED from PHP 7.0.0 ----------"
else
echo "---------- Install mysql ----------"
docker-php-ext-install ${MC} mysql
@ -512,10 +515,10 @@ if [[ -z "${EXTENSIONS##*,mysql,*}" ]]; then
fi
if [[ -z "${EXTENSIONS##*,sodium,*}" ]]; then
isPhpVersionGreaterOrEqual 8 0
isPhpVersionGreaterOrEqual 7 2
if [[ "$?" = "1" ]]; then
echo
echo "Sodium is bundled with PHP from PHP 8.0.0"
echo "Sodium is bundled with PHP from PHP 7.2.0"
echo
else
echo "---------- Install sodium ----------"
@ -526,46 +529,64 @@ fi
if [[ -z "${EXTENSIONS##*,amqp,*}" ]]; then
echo "---------- Install amqp ----------"
apk add --no-cache -U autoconf
apk add --no-cache -U gcc
apk add --no-cache -U linux-headers
apk add --no-cache -U libc-dev
apk add --no-cache --update --virtual .phpize-deps-configure $PHPIZE_DEPS \
&& apk add rabbitmq-c-dev \
&& printf '\n' | pecl install amqp \
&& docker-php-ext-enable amqp \
&& apk del .phpize-deps-configure
apk add --no-cache rabbitmq-c-dev
installExtensionFromTgz amqp-1.10.2
fi
if [[ -z "${EXTENSIONS##*,redis,*}" ]]; then
echo "---------- Install redis ----------"
installExtensionFromTgz redis-5.3.7
isPhpVersionGreaterOrEqual 7 0
if [[ "$?" = "1" ]]; then
installExtensionFromTgz redis-5.2.2
else
printf "\n" | pecl install redis-4.3.0
docker-php-ext-enable redis
fi
fi
if [[ -z "${EXTENSIONS##*,apcu,*}" ]]; then
echo "---------- Install apcu ----------"
pecl install apcu
docker-php-ext-enable apcu
installExtensionFromTgz apcu-5.1.17
fi
if [[ -z "${EXTENSIONS##*,memcached,*}" ]]; then
echo "---------- Install memcached ----------"
apk add --no-cache libmemcached-dev zlib-dev
pecl install memcached-3.2.3
isPhpVersionGreaterOrEqual 7 0
if [[ "$?" = "1" ]]; then
printf "\n" | pecl install memcached-3.1.3
else
printf "\n" | pecl install memcached-2.2.0
fi
docker-php-ext-enable memcached
fi
if [[ -z "${EXTENSIONS##*,memcache,*}" ]]; then
echo "---------- Install memcache ----------"
pecl install memcache
docker-php-ext-enable memcache
isPhpVersionGreaterOrEqual 7 0
if [[ "$?" = "1" ]]; then
installExtensionFromTgz memcache-4.0.5.2
else
installExtensionFromTgz memcache-2.2.6
fi
fi
if [[ -z "${EXTENSIONS##*,xdebug,*}" ]]; then
echo "---------- Install xdebug ----------"
installExtensionFromTgz xdebug-3.2.0
isPhpVersionGreaterOrEqual 7 0
if [[ "$?" = "1" ]]; then
isPhpVersionGreaterOrEqual 7 4
if [[ "$?" = "1" ]]; then
installExtensionFromTgz xdebug-2.9.2
else
installExtensionFromTgz xdebug-2.6.1
fi
else
installExtensionFromTgz xdebug-2.5.5
fi
fi
if [[ -z "${EXTENSIONS##*,event,*}" ]]; then
@ -579,27 +600,38 @@ if [[ -z "${EXTENSIONS##*,event,*}" ]]; then
fi
echo "---------- Install event again ----------"
installExtensionFromTgz event-3.0.5 "--ini-name event.ini"
installExtensionFromTgz event-2.5.6 "--ini-name event.ini"
fi
if [[ -z "${EXTENSIONS##*,mongodb,*}" ]]; then
echo "---------- Install mongodb ----------"
pecl install mongodb
docker-php-ext-enable mongodb
installExtensionFromTgz mongodb-1.7.4
fi
if [[ -z "${EXTENSIONS##*,yaf,*}" ]]; then
echo "---------- Install yaf ----------"
pecl install yaf
isPhpVersionGreaterOrEqual 7 0
if [[ "$?" = "1" ]]; then
printf "\n" | pecl install yaf
docker-php-ext-enable yaf
else
installExtensionFromTgz yaf-2.3.5
fi
fi
if [[ -z "${EXTENSIONS##*,swoole,*}" ]]; then
echo "---------- Install swoole ----------"
isPhpVersionGreaterOrEqual 8 0
# Fix: Refer to the line containing "swoole@alpine)" in file "./install-php-extensions"
apk add --no-cache libstdc++
isPhpVersionGreaterOrEqual 7 0
if [[ "$?" = "1" ]]; then
installExtensionFromTgz swoole-5.0.2 --enable-openssl
installExtensionFromTgz swoole-4.5.2
else
installExtensionFromTgz swoole-2.0.11
fi
fi
@ -608,7 +640,7 @@ if [[ -z "${EXTENSIONS##*,zip,*}" ]]; then
# Fix: https://github.com/docker-library/php/issues/797
apk add --no-cache libzip-dev
isPhpVersionGreaterOrEqual 8 0
isPhpVersionGreaterOrEqual 7 4
if [[ "$?" != "1" ]]; then
docker-php-ext-configure zip --with-libzip=/usr/include
fi
@ -618,39 +650,48 @@ fi
if [[ -z "${EXTENSIONS##*,xhprof,*}" ]]; then
echo "---------- Install XHProf ----------"
pecl install xhprof
docker-php-ext-enable xhprof
isPhpVersionGreaterOrEqual 7 0
if [[ "$?" = "1" ]]; then
mkdir xhprof \
&& tar -xf xhprof-2.2.0.tgz -C xhprof --strip-components=1 \
&& ( cd xhprof/extension/ && phpize && ./configure && make ${MC} && make install ) \
&& docker-php-ext-enable xhprof
else
echo "---------- PHP Version>= 7.0----------"
fi
fi
if [[ -z "${EXTENSIONS##*,xlswriter,*}" ]]; then
echo "---------- Install xlswriter ----------"
isPhpVersionGreaterOrEqual 8 0
isPhpVersionGreaterOrEqual 7 0
if [[ "$?" = "1" ]]; then
printf "\n" | pecl install xlswriter
docker-php-ext-enable xlswriter
else
echo "---------- PHP Version>= 8.0----------"
echo "---------- PHP Version>= 7.0----------"
fi
fi
if [[ -z "${EXTENSIONS##*,rdkafka,*}" ]]; then
echo "---------- Install rdkafka ----------"
isPhpVersionGreaterOrEqual 8 0
isPhpVersionGreaterOrEqual 5 6
if [[ "$?" = "1" ]]; then
apk add librdkafka-dev
printf "\n" | pecl install rdkafka
docker-php-ext-enable rdkafka
else
echo "---------- PHP Version>= 8.0----------"
echo "---------- PHP Version>= 5.6----------"
fi
fi
if [[ -z "${EXTENSIONS##*,zookeeper,*}" ]]; then
echo "---------- Install zookeeper ----------"
isPhpVersionGreaterOrEqual 8 0
isPhpVersionGreaterOrEqual 7 0
if [[ "$?" = "1" ]]; then
apk add re2c
@ -658,26 +699,26 @@ if [[ -z "${EXTENSIONS##*,zookeeper,*}" ]]; then
printf "\n" | pecl install zookeeper
docker-php-ext-enable zookeeper
else
echo "---------- PHP Version>= 8.0----------"
echo "---------- PHP Version>= 7.0----------"
fi
fi
if [[ -z "${EXTENSIONS##*,phalcon,*}" ]]; then
echo "---------- Install phalcon ----------"
isPhpVersionGreaterOrEqual 8 0
isPhpVersionGreaterOrEqual 7 2
if [[ "$?" = "1" ]]; then
printf "\n" | pecl install phalcon
docker-php-ext-enable psr
docker-php-ext-enable phalcon
else
echo "---------- PHP Version>= 8.0----------"
echo "---------- PHP Version>= 7.2----------"
fi
fi
if [[ -z "${EXTENSIONS##*,sdebug,*}" ]]; then
echo "---------- Install sdebug ----------"
isPhpVersionGreaterOrEqual 8 0
isPhpVersionGreaterOrEqual 7 2
if [[ "$?" = "1" ]]; then
curl -SL "https://github.com/swoole/sdebug/archive/sdebug_2_9-beta.tar.gz" -o sdebug.tar.gz \
@ -692,7 +733,7 @@ if [[ -z "${EXTENSIONS##*,sdebug,*}" ]]; then
) \
&& docker-php-ext-enable xdebug
else
echo "---------- PHP Version>= 8.0----------"
echo "---------- PHP Version>= 7.2----------"
fi
fi

View File

@ -311,7 +311,7 @@ serialize_precision = -1
; This directive allows you to disable certain functions for security reasons.
; It receives a comma-delimited list of function names.
; http://php.net/disable-functions
disable_functions = passthru,exec,system,chroot,chgrp,chown,shell_exec,popen,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv
disable_functions =
; This directive allows you to disable certain classes for security reasons.
; It receives a comma-delimited list of class names.

View File

@ -27,9 +27,9 @@ export EXTENSIONS=",${PHP_EXTENSIONS},"
# specific version.
#
# For example, to check if current php is greater than or
# equal to PHP 8.0:
# equal to PHP 7.0:
#
# isPhpVersionGreaterOrEqual 8 0
# isPhpVersionGreaterOrEqual 7 0
#
# Param 1: Specific PHP Major version
# Param 2: Specific PHP Minor version
@ -62,6 +62,7 @@ installExtensionFromTgz()
tgzName=$1
para1=
extensionName="${tgzName%%-*}"
if [ $2 ]; then
para1=$2
fi
@ -72,6 +73,18 @@ installExtensionFromTgz()
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
# end
if [[ -z "${EXTENSIONS##*,pdo_mysql,*}" ]]; then
echo "---------- Install pdo_mysql ----------"
@ -208,19 +221,9 @@ if [[ -z "${EXTENSIONS##*,hprose,*}" ]]; then
docker-php-ext-enable hprose
fi
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##*,gd,*}" ]]; then
echo "---------- Install gd ----------"
isPhpVersionGreaterOrEqual 8 0
isPhpVersionGreaterOrEqual 7 4
if [[ "$?" = "1" ]]; then
# "--with-xxx-dir" was removed from php 7.4,
@ -389,47 +392,47 @@ fi
if [[ -z "${EXTENSIONS##*,ssh2,*}" ]]; then
isPhpVersionGreaterOrEqual 8 0
isPhpVersionGreaterOrEqual 7 0
if [[ "$?" = "1" ]]; then
echo "---------- Install ssh2 ----------"
printf "\n" | apk add libssh2-dev
pecl install ssh2-1.1.2
docker-php-ext-enable ssh2
else
echo "ssh2 requires PHP >= 8.0.0, installed version is ${PHP_VERSION}"
echo "ssh2 requires PHP >= 7.0.0, installed version is ${PHP_VERSION}"
fi
fi
if [[ -z "${EXTENSIONS##*,protobuf,*}" ]]; then
isPhpVersionGreaterOrEqual 8 0
isPhpVersionGreaterOrEqual 7 0
if [[ "$?" = "1" ]]; then
echo "---------- Install protobuf ----------"
printf "\n" | pecl install protobuf
docker-php-ext-enable protobuf
else
echo "yar requires PHP >= 8.0.0, installed version is ${PHP_VERSION}"
echo "yar requires PHP >= 7.0.0, installed version is ${PHP_VERSION}"
fi
fi
if [[ -z "${EXTENSIONS##*,yac,*}" ]]; then
isPhpVersionGreaterOrEqual 8 0
isPhpVersionGreaterOrEqual 7 0
if [[ "$?" = "1" ]]; then
echo "---------- Install yac ----------"
printf "\n" | pecl install yac-2.0.2
docker-php-ext-enable yac
else
echo "yar requires PHP >= 8.0.0, installed version is ${PHP_VERSION}"
echo "yar requires PHP >= 7.0.0, installed version is ${PHP_VERSION}"
fi
fi
if [[ -z "${EXTENSIONS##*,yar,*}" ]]; then
isPhpVersionGreaterOrEqual 8 0
isPhpVersionGreaterOrEqual 7 0
if [[ "$?" = "1" ]]; then
echo "---------- Install yar ----------"
printf "\n" | pecl install yar
docker-php-ext-enable yar
else
echo "yar requires PHP >= 8.0.0, installed version is ${PHP_VERSION}"
echo "yar requires PHP >= 7.0.0, installed version is ${PHP_VERSION}"
fi
fi
@ -437,13 +440,13 @@ fi
if [[ -z "${EXTENSIONS##*,yaconf,*}" ]]; then
isPhpVersionGreaterOrEqual 8 0
isPhpVersionGreaterOrEqual 7 0
if [[ "$?" = "1" ]]; then
echo "---------- Install yaconf ----------"
printf "\n" | pecl install yaconf
docker-php-ext-enable yaconf
else
echo "yar requires PHP >= 8.0.0, installed version is ${PHP_VERSION}"
echo "yar requires PHP >= 7.0.0, installed version is ${PHP_VERSION}"
fi
fi
@ -461,7 +464,7 @@ if [[ -z "${EXTENSIONS##*,varnish,*}" ]]; then
fi
if [[ -z "${EXTENSIONS##*,pdo_sqlsrv,*}" ]]; then
isPhpVersionGreaterOrEqual 8 0
isPhpVersionGreaterOrEqual 7 1
if [[ "$?" = "1" ]]; then
echo "---------- Install pdo_sqlsrv ----------"
apk add --no-cache unixodbc-dev
@ -470,24 +473,24 @@ if [[ -z "${EXTENSIONS##*,pdo_sqlsrv,*}" ]]; then
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 >= 8.0.0, installed version is ${PHP_VERSION}"
echo "pdo_sqlsrv requires PHP >= 7.1.0, installed version is ${PHP_VERSION}"
fi
fi
if [[ -z "${EXTENSIONS##*,sqlsrv,*}" ]]; then
isPhpVersionGreaterOrEqual 8 0
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 >= 8.0.0, installed version is ${PHP_VERSION}"
echo "pdo_sqlsrv requires PHP >= 7.1.0, installed version is ${PHP_VERSION}"
fi
fi
if [[ -z "${EXTENSIONS##*,mcrypt,*}" ]]; then
isPhpVersionGreaterOrEqual 8 0
isPhpVersionGreaterOrEqual 7 0
if [[ "$?" = "1" ]]; then
echo "---------- Install mcrypt ----------"
apk add --no-cache libmcrypt-dev libmcrypt re2c
@ -501,10 +504,10 @@ if [[ -z "${EXTENSIONS##*,mcrypt,*}" ]]; then
fi
if [[ -z "${EXTENSIONS##*,mysql,*}" ]]; then
isPhpVersionGreaterOrEqual 8 0
isPhpVersionGreaterOrEqual 7 0
if [[ "$?" = "1" ]]; then
echo "---------- mysql was REMOVED from PHP 8.0.0 ----------"
echo "---------- mysql was REMOVED from PHP 7.0.0 ----------"
else
echo "---------- Install mysql ----------"
docker-php-ext-install ${MC} mysql
@ -512,10 +515,10 @@ if [[ -z "${EXTENSIONS##*,mysql,*}" ]]; then
fi
if [[ -z "${EXTENSIONS##*,sodium,*}" ]]; then
isPhpVersionGreaterOrEqual 8 0
isPhpVersionGreaterOrEqual 7 2
if [[ "$?" = "1" ]]; then
echo
echo "Sodium is bundled with PHP from PHP 8.0.0"
echo "Sodium is bundled with PHP from PHP 7.2.0"
echo
else
echo "---------- Install sodium ----------"
@ -526,46 +529,64 @@ fi
if [[ -z "${EXTENSIONS##*,amqp,*}" ]]; then
echo "---------- Install amqp ----------"
apk add --no-cache -U autoconf
apk add --no-cache -U gcc
apk add --no-cache -U linux-headers
apk add --no-cache -U libc-dev
apk add --no-cache --update --virtual .phpize-deps-configure $PHPIZE_DEPS \
&& apk add rabbitmq-c-dev \
&& printf '\n' | pecl install amqp \
&& docker-php-ext-enable amqp \
&& apk del .phpize-deps-configure
apk add --no-cache rabbitmq-c-dev
installExtensionFromTgz amqp-1.10.2
fi
if [[ -z "${EXTENSIONS##*,redis,*}" ]]; then
echo "---------- Install redis ----------"
installExtensionFromTgz redis-5.3.7
isPhpVersionGreaterOrEqual 7 0
if [[ "$?" = "1" ]]; then
installExtensionFromTgz redis-5.2.2
else
printf "\n" | pecl install redis-4.3.0
docker-php-ext-enable redis
fi
fi
if [[ -z "${EXTENSIONS##*,apcu,*}" ]]; then
echo "---------- Install apcu ----------"
pecl install apcu
docker-php-ext-enable apcu
installExtensionFromTgz apcu-5.1.17
fi
if [[ -z "${EXTENSIONS##*,memcached,*}" ]]; then
echo "---------- Install memcached ----------"
apk add --no-cache libmemcached-dev zlib-dev
pecl install memcached-3.2.3
isPhpVersionGreaterOrEqual 7 0
if [[ "$?" = "1" ]]; then
printf "\n" | pecl install memcached-3.1.3
else
printf "\n" | pecl install memcached-2.2.0
fi
docker-php-ext-enable memcached
fi
if [[ -z "${EXTENSIONS##*,memcache,*}" ]]; then
echo "---------- Install memcache ----------"
pecl install memcache
docker-php-ext-enable memcache
isPhpVersionGreaterOrEqual 7 0
if [[ "$?" = "1" ]]; then
installExtensionFromTgz memcache-4.0.5.2
else
installExtensionFromTgz memcache-2.2.6
fi
fi
if [[ -z "${EXTENSIONS##*,xdebug,*}" ]]; then
echo "---------- Install xdebug ----------"
installExtensionFromTgz xdebug-3.2.0
isPhpVersionGreaterOrEqual 7 0
if [[ "$?" = "1" ]]; then
isPhpVersionGreaterOrEqual 7 4
if [[ "$?" = "1" ]]; then
installExtensionFromTgz xdebug-2.9.2
else
installExtensionFromTgz xdebug-2.6.1
fi
else
installExtensionFromTgz xdebug-2.5.5
fi
fi
if [[ -z "${EXTENSIONS##*,event,*}" ]]; then
@ -579,27 +600,38 @@ if [[ -z "${EXTENSIONS##*,event,*}" ]]; then
fi
echo "---------- Install event again ----------"
installExtensionFromTgz event-3.0.5 "--ini-name event.ini"
installExtensionFromTgz event-2.5.6 "--ini-name event.ini"
fi
if [[ -z "${EXTENSIONS##*,mongodb,*}" ]]; then
echo "---------- Install mongodb ----------"
pecl install mongodb
docker-php-ext-enable mongodb
installExtensionFromTgz mongodb-1.7.4
fi
if [[ -z "${EXTENSIONS##*,yaf,*}" ]]; then
echo "---------- Install yaf ----------"
pecl install yaf
isPhpVersionGreaterOrEqual 7 0
if [[ "$?" = "1" ]]; then
printf "\n" | pecl install yaf
docker-php-ext-enable yaf
else
installExtensionFromTgz yaf-2.3.5
fi
fi
if [[ -z "${EXTENSIONS##*,swoole,*}" ]]; then
echo "---------- Install swoole ----------"
isPhpVersionGreaterOrEqual 8 0
# Fix: Refer to the line containing "swoole@alpine)" in file "./install-php-extensions"
apk add --no-cache libstdc++
isPhpVersionGreaterOrEqual 7 0
if [[ "$?" = "1" ]]; then
installExtensionFromTgz swoole-5.0.2 --enable-openssl
installExtensionFromTgz swoole-4.5.2
else
installExtensionFromTgz swoole-2.0.11
fi
fi
@ -608,7 +640,7 @@ if [[ -z "${EXTENSIONS##*,zip,*}" ]]; then
# Fix: https://github.com/docker-library/php/issues/797
apk add --no-cache libzip-dev
isPhpVersionGreaterOrEqual 8 0
isPhpVersionGreaterOrEqual 7 4
if [[ "$?" != "1" ]]; then
docker-php-ext-configure zip --with-libzip=/usr/include
fi
@ -618,39 +650,48 @@ fi
if [[ -z "${EXTENSIONS##*,xhprof,*}" ]]; then
echo "---------- Install XHProf ----------"
pecl install xhprof
docker-php-ext-enable xhprof
isPhpVersionGreaterOrEqual 7 0
if [[ "$?" = "1" ]]; then
mkdir xhprof \
&& tar -xf xhprof-2.2.0.tgz -C xhprof --strip-components=1 \
&& ( cd xhprof/extension/ && phpize && ./configure && make ${MC} && make install ) \
&& docker-php-ext-enable xhprof
else
echo "---------- PHP Version>= 7.0----------"
fi
fi
if [[ -z "${EXTENSIONS##*,xlswriter,*}" ]]; then
echo "---------- Install xlswriter ----------"
isPhpVersionGreaterOrEqual 8 0
isPhpVersionGreaterOrEqual 7 0
if [[ "$?" = "1" ]]; then
printf "\n" | pecl install xlswriter
docker-php-ext-enable xlswriter
else
echo "---------- PHP Version>= 8.0----------"
echo "---------- PHP Version>= 7.0----------"
fi
fi
if [[ -z "${EXTENSIONS##*,rdkafka,*}" ]]; then
echo "---------- Install rdkafka ----------"
isPhpVersionGreaterOrEqual 8 0
isPhpVersionGreaterOrEqual 5 6
if [[ "$?" = "1" ]]; then
apk add librdkafka-dev
printf "\n" | pecl install rdkafka
docker-php-ext-enable rdkafka
else
echo "---------- PHP Version>= 8.0----------"
echo "---------- PHP Version>= 5.6----------"
fi
fi
if [[ -z "${EXTENSIONS##*,zookeeper,*}" ]]; then
echo "---------- Install zookeeper ----------"
isPhpVersionGreaterOrEqual 8 0
isPhpVersionGreaterOrEqual 7 0
if [[ "$?" = "1" ]]; then
apk add re2c
@ -658,26 +699,26 @@ if [[ -z "${EXTENSIONS##*,zookeeper,*}" ]]; then
printf "\n" | pecl install zookeeper
docker-php-ext-enable zookeeper
else
echo "---------- PHP Version>= 8.0----------"
echo "---------- PHP Version>= 7.0----------"
fi
fi
if [[ -z "${EXTENSIONS##*,phalcon,*}" ]]; then
echo "---------- Install phalcon ----------"
isPhpVersionGreaterOrEqual 8 0
isPhpVersionGreaterOrEqual 7 2
if [[ "$?" = "1" ]]; then
printf "\n" | pecl install phalcon
docker-php-ext-enable psr
docker-php-ext-enable phalcon
else
echo "---------- PHP Version>= 8.0----------"
echo "---------- PHP Version>= 7.2----------"
fi
fi
if [[ -z "${EXTENSIONS##*,sdebug,*}" ]]; then
echo "---------- Install sdebug ----------"
isPhpVersionGreaterOrEqual 8 0
isPhpVersionGreaterOrEqual 7 2
if [[ "$?" = "1" ]]; then
curl -SL "https://github.com/swoole/sdebug/archive/sdebug_2_9-beta.tar.gz" -o sdebug.tar.gz \
@ -692,7 +733,7 @@ if [[ -z "${EXTENSIONS##*,sdebug,*}" ]]; then
) \
&& docker-php-ext-enable xdebug
else
echo "---------- PHP Version>= 8.0----------"
echo "---------- PHP Version>= 7.2----------"
fi
fi

View File

@ -311,7 +311,7 @@ serialize_precision = -1
; This directive allows you to disable certain functions for security reasons.
; It receives a comma-delimited list of function names.
; http://php.net/disable-functions
disable_functions = passthru,exec,system,chroot,chgrp,chown,shell_exec,popen,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv
disable_functions =
; This directive allows you to disable certain classes for security reasons.
; It receives a comma-delimited list of class names.

View File

@ -27,9 +27,9 @@ export EXTENSIONS=",${PHP_EXTENSIONS},"
# specific version.
#
# For example, to check if current php is greater than or
# equal to PHP 8.0:
# equal to PHP 7.0:
#
# isPhpVersionGreaterOrEqual 8 0
# isPhpVersionGreaterOrEqual 7 0
#
# Param 1: Specific PHP Major version
# Param 2: Specific PHP Minor version
@ -62,6 +62,7 @@ installExtensionFromTgz()
tgzName=$1
para1=
extensionName="${tgzName%%-*}"
if [ $2 ]; then
para1=$2
fi
@ -72,6 +73,18 @@ installExtensionFromTgz()
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
# end
if [[ -z "${EXTENSIONS##*,pdo_mysql,*}" ]]; then
echo "---------- Install pdo_mysql ----------"
@ -208,19 +221,9 @@ if [[ -z "${EXTENSIONS##*,hprose,*}" ]]; then
docker-php-ext-enable hprose
fi
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##*,gd,*}" ]]; then
echo "---------- Install gd ----------"
isPhpVersionGreaterOrEqual 8 0
isPhpVersionGreaterOrEqual 7 4
if [[ "$?" = "1" ]]; then
# "--with-xxx-dir" was removed from php 7.4,
@ -389,47 +392,47 @@ fi
if [[ -z "${EXTENSIONS##*,ssh2,*}" ]]; then
isPhpVersionGreaterOrEqual 8 0
isPhpVersionGreaterOrEqual 7 0
if [[ "$?" = "1" ]]; then
echo "---------- Install ssh2 ----------"
printf "\n" | apk add libssh2-dev
pecl install ssh2-1.1.2
docker-php-ext-enable ssh2
else
echo "ssh2 requires PHP >= 8.0.0, installed version is ${PHP_VERSION}"
echo "ssh2 requires PHP >= 7.0.0, installed version is ${PHP_VERSION}"
fi
fi
if [[ -z "${EXTENSIONS##*,protobuf,*}" ]]; then
isPhpVersionGreaterOrEqual 8 0
isPhpVersionGreaterOrEqual 7 0
if [[ "$?" = "1" ]]; then
echo "---------- Install protobuf ----------"
printf "\n" | pecl install protobuf
docker-php-ext-enable protobuf
else
echo "yar requires PHP >= 8.0.0, installed version is ${PHP_VERSION}"
echo "yar requires PHP >= 7.0.0, installed version is ${PHP_VERSION}"
fi
fi
if [[ -z "${EXTENSIONS##*,yac,*}" ]]; then
isPhpVersionGreaterOrEqual 8 0
isPhpVersionGreaterOrEqual 7 0
if [[ "$?" = "1" ]]; then
echo "---------- Install yac ----------"
printf "\n" | pecl install yac-2.0.2
docker-php-ext-enable yac
else
echo "yar requires PHP >= 8.0.0, installed version is ${PHP_VERSION}"
echo "yar requires PHP >= 7.0.0, installed version is ${PHP_VERSION}"
fi
fi
if [[ -z "${EXTENSIONS##*,yar,*}" ]]; then
isPhpVersionGreaterOrEqual 8 0
isPhpVersionGreaterOrEqual 7 0
if [[ "$?" = "1" ]]; then
echo "---------- Install yar ----------"
printf "\n" | pecl install yar
docker-php-ext-enable yar
else
echo "yar requires PHP >= 8.0.0, installed version is ${PHP_VERSION}"
echo "yar requires PHP >= 7.0.0, installed version is ${PHP_VERSION}"
fi
fi
@ -437,13 +440,13 @@ fi
if [[ -z "${EXTENSIONS##*,yaconf,*}" ]]; then
isPhpVersionGreaterOrEqual 8 0
isPhpVersionGreaterOrEqual 7 0
if [[ "$?" = "1" ]]; then
echo "---------- Install yaconf ----------"
printf "\n" | pecl install yaconf
docker-php-ext-enable yaconf
else
echo "yar requires PHP >= 8.0.0, installed version is ${PHP_VERSION}"
echo "yar requires PHP >= 7.0.0, installed version is ${PHP_VERSION}"
fi
fi
@ -461,7 +464,7 @@ if [[ -z "${EXTENSIONS##*,varnish,*}" ]]; then
fi
if [[ -z "${EXTENSIONS##*,pdo_sqlsrv,*}" ]]; then
isPhpVersionGreaterOrEqual 8 0
isPhpVersionGreaterOrEqual 7 1
if [[ "$?" = "1" ]]; then
echo "---------- Install pdo_sqlsrv ----------"
apk add --no-cache unixodbc-dev
@ -470,24 +473,24 @@ if [[ -z "${EXTENSIONS##*,pdo_sqlsrv,*}" ]]; then
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 >= 8.0.0, installed version is ${PHP_VERSION}"
echo "pdo_sqlsrv requires PHP >= 7.1.0, installed version is ${PHP_VERSION}"
fi
fi
if [[ -z "${EXTENSIONS##*,sqlsrv,*}" ]]; then
isPhpVersionGreaterOrEqual 8 0
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 >= 8.0.0, installed version is ${PHP_VERSION}"
echo "pdo_sqlsrv requires PHP >= 7.1.0, installed version is ${PHP_VERSION}"
fi
fi
if [[ -z "${EXTENSIONS##*,mcrypt,*}" ]]; then
isPhpVersionGreaterOrEqual 8 0
isPhpVersionGreaterOrEqual 7 0
if [[ "$?" = "1" ]]; then
echo "---------- Install mcrypt ----------"
apk add --no-cache libmcrypt-dev libmcrypt re2c
@ -501,10 +504,10 @@ if [[ -z "${EXTENSIONS##*,mcrypt,*}" ]]; then
fi
if [[ -z "${EXTENSIONS##*,mysql,*}" ]]; then
isPhpVersionGreaterOrEqual 8 0
isPhpVersionGreaterOrEqual 7 0
if [[ "$?" = "1" ]]; then
echo "---------- mysql was REMOVED from PHP 8.0.0 ----------"
echo "---------- mysql was REMOVED from PHP 7.0.0 ----------"
else
echo "---------- Install mysql ----------"
docker-php-ext-install ${MC} mysql
@ -512,10 +515,10 @@ if [[ -z "${EXTENSIONS##*,mysql,*}" ]]; then
fi
if [[ -z "${EXTENSIONS##*,sodium,*}" ]]; then
isPhpVersionGreaterOrEqual 8 0
isPhpVersionGreaterOrEqual 7 2
if [[ "$?" = "1" ]]; then
echo
echo "Sodium is bundled with PHP from PHP 8.0.0"
echo "Sodium is bundled with PHP from PHP 7.2.0"
echo
else
echo "---------- Install sodium ----------"
@ -526,46 +529,64 @@ fi
if [[ -z "${EXTENSIONS##*,amqp,*}" ]]; then
echo "---------- Install amqp ----------"
apk add --no-cache -U autoconf
apk add --no-cache -U gcc
apk add --no-cache -U linux-headers
apk add --no-cache -U libc-dev
apk add --no-cache --update --virtual .phpize-deps-configure $PHPIZE_DEPS \
&& apk add rabbitmq-c-dev \
&& printf '\n' | pecl install amqp \
&& docker-php-ext-enable amqp \
&& apk del .phpize-deps-configure
apk add --no-cache rabbitmq-c-dev
installExtensionFromTgz amqp-1.10.2
fi
if [[ -z "${EXTENSIONS##*,redis,*}" ]]; then
echo "---------- Install redis ----------"
installExtensionFromTgz redis-5.3.7
isPhpVersionGreaterOrEqual 7 0
if [[ "$?" = "1" ]]; then
installExtensionFromTgz redis-5.2.2
else
printf "\n" | pecl install redis-4.3.0
docker-php-ext-enable redis
fi
fi
if [[ -z "${EXTENSIONS##*,apcu,*}" ]]; then
echo "---------- Install apcu ----------"
pecl install apcu
docker-php-ext-enable apcu
installExtensionFromTgz apcu-5.1.17
fi
if [[ -z "${EXTENSIONS##*,memcached,*}" ]]; then
echo "---------- Install memcached ----------"
apk add --no-cache libmemcached-dev zlib-dev
pecl install memcached-3.2.3
isPhpVersionGreaterOrEqual 7 0
if [[ "$?" = "1" ]]; then
printf "\n" | pecl install memcached-3.1.3
else
printf "\n" | pecl install memcached-2.2.0
fi
docker-php-ext-enable memcached
fi
if [[ -z "${EXTENSIONS##*,memcache,*}" ]]; then
echo "---------- Install memcache ----------"
pecl install memcache
docker-php-ext-enable memcache
isPhpVersionGreaterOrEqual 7 0
if [[ "$?" = "1" ]]; then
installExtensionFromTgz memcache-4.0.5.2
else
installExtensionFromTgz memcache-2.2.6
fi
fi
if [[ -z "${EXTENSIONS##*,xdebug,*}" ]]; then
echo "---------- Install xdebug ----------"
installExtensionFromTgz xdebug-3.2.0
isPhpVersionGreaterOrEqual 7 0
if [[ "$?" = "1" ]]; then
isPhpVersionGreaterOrEqual 7 4
if [[ "$?" = "1" ]]; then
installExtensionFromTgz xdebug-2.9.2
else
installExtensionFromTgz xdebug-2.6.1
fi
else
installExtensionFromTgz xdebug-2.5.5
fi
fi
if [[ -z "${EXTENSIONS##*,event,*}" ]]; then
@ -579,27 +600,38 @@ if [[ -z "${EXTENSIONS##*,event,*}" ]]; then
fi
echo "---------- Install event again ----------"
installExtensionFromTgz event-3.0.5 "--ini-name event.ini"
installExtensionFromTgz event-2.5.6 "--ini-name event.ini"
fi
if [[ -z "${EXTENSIONS##*,mongodb,*}" ]]; then
echo "---------- Install mongodb ----------"
pecl install mongodb
docker-php-ext-enable mongodb
installExtensionFromTgz mongodb-1.7.4
fi
if [[ -z "${EXTENSIONS##*,yaf,*}" ]]; then
echo "---------- Install yaf ----------"
pecl install yaf
isPhpVersionGreaterOrEqual 7 0
if [[ "$?" = "1" ]]; then
printf "\n" | pecl install yaf
docker-php-ext-enable yaf
else
installExtensionFromTgz yaf-2.3.5
fi
fi
if [[ -z "${EXTENSIONS##*,swoole,*}" ]]; then
echo "---------- Install swoole ----------"
isPhpVersionGreaterOrEqual 8 0
# Fix: Refer to the line containing "swoole@alpine)" in file "./install-php-extensions"
apk add --no-cache libstdc++
isPhpVersionGreaterOrEqual 7 0
if [[ "$?" = "1" ]]; then
installExtensionFromTgz swoole-5.0.2 --enable-openssl
installExtensionFromTgz swoole-4.5.2
else
installExtensionFromTgz swoole-2.0.11
fi
fi
@ -608,7 +640,7 @@ if [[ -z "${EXTENSIONS##*,zip,*}" ]]; then
# Fix: https://github.com/docker-library/php/issues/797
apk add --no-cache libzip-dev
isPhpVersionGreaterOrEqual 8 0
isPhpVersionGreaterOrEqual 7 4
if [[ "$?" != "1" ]]; then
docker-php-ext-configure zip --with-libzip=/usr/include
fi
@ -618,39 +650,48 @@ fi
if [[ -z "${EXTENSIONS##*,xhprof,*}" ]]; then
echo "---------- Install XHProf ----------"
pecl install xhprof
docker-php-ext-enable xhprof
isPhpVersionGreaterOrEqual 7 0
if [[ "$?" = "1" ]]; then
mkdir xhprof \
&& tar -xf xhprof-2.2.0.tgz -C xhprof --strip-components=1 \
&& ( cd xhprof/extension/ && phpize && ./configure && make ${MC} && make install ) \
&& docker-php-ext-enable xhprof
else
echo "---------- PHP Version>= 7.0----------"
fi
fi
if [[ -z "${EXTENSIONS##*,xlswriter,*}" ]]; then
echo "---------- Install xlswriter ----------"
isPhpVersionGreaterOrEqual 8 0
isPhpVersionGreaterOrEqual 7 0
if [[ "$?" = "1" ]]; then
printf "\n" | pecl install xlswriter
docker-php-ext-enable xlswriter
else
echo "---------- PHP Version>= 8.0----------"
echo "---------- PHP Version>= 7.0----------"
fi
fi
if [[ -z "${EXTENSIONS##*,rdkafka,*}" ]]; then
echo "---------- Install rdkafka ----------"
isPhpVersionGreaterOrEqual 8 0
isPhpVersionGreaterOrEqual 5 6
if [[ "$?" = "1" ]]; then
apk add librdkafka-dev
printf "\n" | pecl install rdkafka
docker-php-ext-enable rdkafka
else
echo "---------- PHP Version>= 8.0----------"
echo "---------- PHP Version>= 5.6----------"
fi
fi
if [[ -z "${EXTENSIONS##*,zookeeper,*}" ]]; then
echo "---------- Install zookeeper ----------"
isPhpVersionGreaterOrEqual 8 0
isPhpVersionGreaterOrEqual 7 0
if [[ "$?" = "1" ]]; then
apk add re2c
@ -658,26 +699,26 @@ if [[ -z "${EXTENSIONS##*,zookeeper,*}" ]]; then
printf "\n" | pecl install zookeeper
docker-php-ext-enable zookeeper
else
echo "---------- PHP Version>= 8.0----------"
echo "---------- PHP Version>= 7.0----------"
fi
fi
if [[ -z "${EXTENSIONS##*,phalcon,*}" ]]; then
echo "---------- Install phalcon ----------"
isPhpVersionGreaterOrEqual 8 0
isPhpVersionGreaterOrEqual 7 2
if [[ "$?" = "1" ]]; then
printf "\n" | pecl install phalcon
docker-php-ext-enable psr
docker-php-ext-enable phalcon
else
echo "---------- PHP Version>= 8.0----------"
echo "---------- PHP Version>= 7.2----------"
fi
fi
if [[ -z "${EXTENSIONS##*,sdebug,*}" ]]; then
echo "---------- Install sdebug ----------"
isPhpVersionGreaterOrEqual 8 0
isPhpVersionGreaterOrEqual 7 2
if [[ "$?" = "1" ]]; then
curl -SL "https://github.com/swoole/sdebug/archive/sdebug_2_9-beta.tar.gz" -o sdebug.tar.gz \
@ -692,7 +733,7 @@ if [[ -z "${EXTENSIONS##*,sdebug,*}" ]]; then
) \
&& docker-php-ext-enable xdebug
else
echo "---------- PHP Version>= 8.0----------"
echo "---------- PHP Version>= 7.2----------"
fi
fi

View File

@ -311,7 +311,7 @@ serialize_precision = -1
; This directive allows you to disable certain functions for security reasons.
; It receives a comma-delimited list of function names.
; http://php.net/disable-functions
disable_functions = passthru,exec,system,chroot,chgrp,chown,shell_exec,popen,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv
disable_functions =
; This directive allows you to disable certain classes for security reasons.
; It receives a comma-delimited list of class names.

View File

@ -27,9 +27,9 @@ export EXTENSIONS=",${PHP_EXTENSIONS},"
# specific version.
#
# For example, to check if current php is greater than or
# equal to PHP 8.0:
# equal to PHP 7.0:
#
# isPhpVersionGreaterOrEqual 8 0
# isPhpVersionGreaterOrEqual 7 0
#
# Param 1: Specific PHP Major version
# Param 2: Specific PHP Minor version
@ -62,6 +62,7 @@ installExtensionFromTgz()
tgzName=$1
para1=
extensionName="${tgzName%%-*}"
if [ $2 ]; then
para1=$2
fi
@ -72,6 +73,18 @@ installExtensionFromTgz()
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
# end
if [[ -z "${EXTENSIONS##*,pdo_mysql,*}" ]]; then
echo "---------- Install pdo_mysql ----------"
@ -208,19 +221,9 @@ if [[ -z "${EXTENSIONS##*,hprose,*}" ]]; then
docker-php-ext-enable hprose
fi
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##*,gd,*}" ]]; then
echo "---------- Install gd ----------"
isPhpVersionGreaterOrEqual 8 0
isPhpVersionGreaterOrEqual 7 4
if [[ "$?" = "1" ]]; then
# "--with-xxx-dir" was removed from php 7.4,
@ -389,47 +392,47 @@ fi
if [[ -z "${EXTENSIONS##*,ssh2,*}" ]]; then
isPhpVersionGreaterOrEqual 8 0
isPhpVersionGreaterOrEqual 7 0
if [[ "$?" = "1" ]]; then
echo "---------- Install ssh2 ----------"
printf "\n" | apk add libssh2-dev
pecl install ssh2-1.1.2
docker-php-ext-enable ssh2
else
echo "ssh2 requires PHP >= 8.0.0, installed version is ${PHP_VERSION}"
echo "ssh2 requires PHP >= 7.0.0, installed version is ${PHP_VERSION}"
fi
fi
if [[ -z "${EXTENSIONS##*,protobuf,*}" ]]; then
isPhpVersionGreaterOrEqual 8 0
isPhpVersionGreaterOrEqual 7 0
if [[ "$?" = "1" ]]; then
echo "---------- Install protobuf ----------"
printf "\n" | pecl install protobuf
docker-php-ext-enable protobuf
else
echo "yar requires PHP >= 8.0.0, installed version is ${PHP_VERSION}"
echo "yar requires PHP >= 7.0.0, installed version is ${PHP_VERSION}"
fi
fi
if [[ -z "${EXTENSIONS##*,yac,*}" ]]; then
isPhpVersionGreaterOrEqual 8 0
isPhpVersionGreaterOrEqual 7 0
if [[ "$?" = "1" ]]; then
echo "---------- Install yac ----------"
printf "\n" | pecl install yac-2.0.2
docker-php-ext-enable yac
else
echo "yar requires PHP >= 8.0.0, installed version is ${PHP_VERSION}"
echo "yar requires PHP >= 7.0.0, installed version is ${PHP_VERSION}"
fi
fi
if [[ -z "${EXTENSIONS##*,yar,*}" ]]; then
isPhpVersionGreaterOrEqual 8 0
isPhpVersionGreaterOrEqual 7 0
if [[ "$?" = "1" ]]; then
echo "---------- Install yar ----------"
printf "\n" | pecl install yar
docker-php-ext-enable yar
else
echo "yar requires PHP >= 8.0.0, installed version is ${PHP_VERSION}"
echo "yar requires PHP >= 7.0.0, installed version is ${PHP_VERSION}"
fi
fi
@ -437,13 +440,13 @@ fi
if [[ -z "${EXTENSIONS##*,yaconf,*}" ]]; then
isPhpVersionGreaterOrEqual 8 0
isPhpVersionGreaterOrEqual 7 0
if [[ "$?" = "1" ]]; then
echo "---------- Install yaconf ----------"
printf "\n" | pecl install yaconf
docker-php-ext-enable yaconf
else
echo "yar requires PHP >= 8.0.0, installed version is ${PHP_VERSION}"
echo "yar requires PHP >= 7.0.0, installed version is ${PHP_VERSION}"
fi
fi
@ -461,7 +464,7 @@ if [[ -z "${EXTENSIONS##*,varnish,*}" ]]; then
fi
if [[ -z "${EXTENSIONS##*,pdo_sqlsrv,*}" ]]; then
isPhpVersionGreaterOrEqual 8 0
isPhpVersionGreaterOrEqual 7 1
if [[ "$?" = "1" ]]; then
echo "---------- Install pdo_sqlsrv ----------"
apk add --no-cache unixodbc-dev
@ -470,24 +473,24 @@ if [[ -z "${EXTENSIONS##*,pdo_sqlsrv,*}" ]]; then
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 >= 8.0.0, installed version is ${PHP_VERSION}"
echo "pdo_sqlsrv requires PHP >= 7.1.0, installed version is ${PHP_VERSION}"
fi
fi
if [[ -z "${EXTENSIONS##*,sqlsrv,*}" ]]; then
isPhpVersionGreaterOrEqual 8 0
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 >= 8.0.0, installed version is ${PHP_VERSION}"
echo "pdo_sqlsrv requires PHP >= 7.1.0, installed version is ${PHP_VERSION}"
fi
fi
if [[ -z "${EXTENSIONS##*,mcrypt,*}" ]]; then
isPhpVersionGreaterOrEqual 8 0
isPhpVersionGreaterOrEqual 7 0
if [[ "$?" = "1" ]]; then
echo "---------- Install mcrypt ----------"
apk add --no-cache libmcrypt-dev libmcrypt re2c
@ -501,10 +504,10 @@ if [[ -z "${EXTENSIONS##*,mcrypt,*}" ]]; then
fi
if [[ -z "${EXTENSIONS##*,mysql,*}" ]]; then
isPhpVersionGreaterOrEqual 8 0
isPhpVersionGreaterOrEqual 7 0
if [[ "$?" = "1" ]]; then
echo "---------- mysql was REMOVED from PHP 8.0.0 ----------"
echo "---------- mysql was REMOVED from PHP 7.0.0 ----------"
else
echo "---------- Install mysql ----------"
docker-php-ext-install ${MC} mysql
@ -512,10 +515,10 @@ if [[ -z "${EXTENSIONS##*,mysql,*}" ]]; then
fi
if [[ -z "${EXTENSIONS##*,sodium,*}" ]]; then
isPhpVersionGreaterOrEqual 8 0
isPhpVersionGreaterOrEqual 7 2
if [[ "$?" = "1" ]]; then
echo
echo "Sodium is bundled with PHP from PHP 8.0.0"
echo "Sodium is bundled with PHP from PHP 7.2.0"
echo
else
echo "---------- Install sodium ----------"
@ -526,46 +529,64 @@ fi
if [[ -z "${EXTENSIONS##*,amqp,*}" ]]; then
echo "---------- Install amqp ----------"
apk add --no-cache -U autoconf
apk add --no-cache -U gcc
apk add --no-cache -U linux-headers
apk add --no-cache -U libc-dev
apk add --no-cache --update --virtual .phpize-deps-configure $PHPIZE_DEPS \
&& apk add rabbitmq-c-dev \
&& printf '\n' | pecl install amqp \
&& docker-php-ext-enable amqp \
&& apk del .phpize-deps-configure
apk add --no-cache rabbitmq-c-dev
installExtensionFromTgz amqp-1.10.2
fi
if [[ -z "${EXTENSIONS##*,redis,*}" ]]; then
echo "---------- Install redis ----------"
installExtensionFromTgz redis-5.3.7
isPhpVersionGreaterOrEqual 7 0
if [[ "$?" = "1" ]]; then
installExtensionFromTgz redis-5.2.2
else
printf "\n" | pecl install redis-4.3.0
docker-php-ext-enable redis
fi
fi
if [[ -z "${EXTENSIONS##*,apcu,*}" ]]; then
echo "---------- Install apcu ----------"
pecl install apcu
docker-php-ext-enable apcu
installExtensionFromTgz apcu-5.1.17
fi
if [[ -z "${EXTENSIONS##*,memcached,*}" ]]; then
echo "---------- Install memcached ----------"
apk add --no-cache libmemcached-dev zlib-dev
pecl install memcached-3.2.3
isPhpVersionGreaterOrEqual 7 0
if [[ "$?" = "1" ]]; then
printf "\n" | pecl install memcached-3.1.3
else
printf "\n" | pecl install memcached-2.2.0
fi
docker-php-ext-enable memcached
fi
if [[ -z "${EXTENSIONS##*,memcache,*}" ]]; then
echo "---------- Install memcache ----------"
pecl install memcache
docker-php-ext-enable memcache
isPhpVersionGreaterOrEqual 7 0
if [[ "$?" = "1" ]]; then
installExtensionFromTgz memcache-4.0.5.2
else
installExtensionFromTgz memcache-2.2.6
fi
fi
if [[ -z "${EXTENSIONS##*,xdebug,*}" ]]; then
echo "---------- Install xdebug ----------"
installExtensionFromTgz xdebug-3.2.0
isPhpVersionGreaterOrEqual 7 0
if [[ "$?" = "1" ]]; then
isPhpVersionGreaterOrEqual 7 4
if [[ "$?" = "1" ]]; then
installExtensionFromTgz xdebug-2.9.2
else
installExtensionFromTgz xdebug-2.6.1
fi
else
installExtensionFromTgz xdebug-2.5.5
fi
fi
if [[ -z "${EXTENSIONS##*,event,*}" ]]; then
@ -579,27 +600,38 @@ if [[ -z "${EXTENSIONS##*,event,*}" ]]; then
fi
echo "---------- Install event again ----------"
installExtensionFromTgz event-3.0.5 "--ini-name event.ini"
installExtensionFromTgz event-2.5.6 "--ini-name event.ini"
fi
if [[ -z "${EXTENSIONS##*,mongodb,*}" ]]; then
echo "---------- Install mongodb ----------"
pecl install mongodb
docker-php-ext-enable mongodb
installExtensionFromTgz mongodb-1.7.4
fi
if [[ -z "${EXTENSIONS##*,yaf,*}" ]]; then
echo "---------- Install yaf ----------"
pecl install yaf
isPhpVersionGreaterOrEqual 7 0
if [[ "$?" = "1" ]]; then
printf "\n" | pecl install yaf
docker-php-ext-enable yaf
else
installExtensionFromTgz yaf-2.3.5
fi
fi
if [[ -z "${EXTENSIONS##*,swoole,*}" ]]; then
echo "---------- Install swoole ----------"
isPhpVersionGreaterOrEqual 8 0
# Fix: Refer to the line containing "swoole@alpine)" in file "./install-php-extensions"
apk add --no-cache libstdc++
isPhpVersionGreaterOrEqual 7 0
if [[ "$?" = "1" ]]; then
installExtensionFromTgz swoole-5.0.2 --enable-openssl
installExtensionFromTgz swoole-4.5.2
else
installExtensionFromTgz swoole-2.0.11
fi
fi
@ -608,7 +640,7 @@ if [[ -z "${EXTENSIONS##*,zip,*}" ]]; then
# Fix: https://github.com/docker-library/php/issues/797
apk add --no-cache libzip-dev
isPhpVersionGreaterOrEqual 8 0
isPhpVersionGreaterOrEqual 7 4
if [[ "$?" != "1" ]]; then
docker-php-ext-configure zip --with-libzip=/usr/include
fi
@ -618,39 +650,48 @@ fi
if [[ -z "${EXTENSIONS##*,xhprof,*}" ]]; then
echo "---------- Install XHProf ----------"
pecl install xhprof
docker-php-ext-enable xhprof
isPhpVersionGreaterOrEqual 7 0
if [[ "$?" = "1" ]]; then
mkdir xhprof \
&& tar -xf xhprof-2.2.0.tgz -C xhprof --strip-components=1 \
&& ( cd xhprof/extension/ && phpize && ./configure && make ${MC} && make install ) \
&& docker-php-ext-enable xhprof
else
echo "---------- PHP Version>= 7.0----------"
fi
fi
if [[ -z "${EXTENSIONS##*,xlswriter,*}" ]]; then
echo "---------- Install xlswriter ----------"
isPhpVersionGreaterOrEqual 8 0
isPhpVersionGreaterOrEqual 7 0
if [[ "$?" = "1" ]]; then
printf "\n" | pecl install xlswriter
docker-php-ext-enable xlswriter
else
echo "---------- PHP Version>= 8.0----------"
echo "---------- PHP Version>= 7.0----------"
fi
fi
if [[ -z "${EXTENSIONS##*,rdkafka,*}" ]]; then
echo "---------- Install rdkafka ----------"
isPhpVersionGreaterOrEqual 8 0
isPhpVersionGreaterOrEqual 5 6
if [[ "$?" = "1" ]]; then
apk add librdkafka-dev
printf "\n" | pecl install rdkafka
docker-php-ext-enable rdkafka
else
echo "---------- PHP Version>= 8.0----------"
echo "---------- PHP Version>= 5.6----------"
fi
fi
if [[ -z "${EXTENSIONS##*,zookeeper,*}" ]]; then
echo "---------- Install zookeeper ----------"
isPhpVersionGreaterOrEqual 8 0
isPhpVersionGreaterOrEqual 7 0
if [[ "$?" = "1" ]]; then
apk add re2c
@ -658,26 +699,26 @@ if [[ -z "${EXTENSIONS##*,zookeeper,*}" ]]; then
printf "\n" | pecl install zookeeper
docker-php-ext-enable zookeeper
else
echo "---------- PHP Version>= 8.0----------"
echo "---------- PHP Version>= 7.0----------"
fi
fi
if [[ -z "${EXTENSIONS##*,phalcon,*}" ]]; then
echo "---------- Install phalcon ----------"
isPhpVersionGreaterOrEqual 8 0
isPhpVersionGreaterOrEqual 7 2
if [[ "$?" = "1" ]]; then
printf "\n" | pecl install phalcon
docker-php-ext-enable psr
docker-php-ext-enable phalcon
else
echo "---------- PHP Version>= 8.0----------"
echo "---------- PHP Version>= 7.2----------"
fi
fi
if [[ -z "${EXTENSIONS##*,sdebug,*}" ]]; then
echo "---------- Install sdebug ----------"
isPhpVersionGreaterOrEqual 8 0
isPhpVersionGreaterOrEqual 7 2
if [[ "$?" = "1" ]]; then
curl -SL "https://github.com/swoole/sdebug/archive/sdebug_2_9-beta.tar.gz" -o sdebug.tar.gz \
@ -692,7 +733,7 @@ if [[ -z "${EXTENSIONS##*,sdebug,*}" ]]; then
) \
&& docker-php-ext-enable xdebug
else
echo "---------- PHP Version>= 8.0----------"
echo "---------- PHP Version>= 7.2----------"
fi
fi

View File

@ -311,7 +311,7 @@ serialize_precision = -1
; This directive allows you to disable certain functions for security reasons.
; It receives a comma-delimited list of function names.
; http://php.net/disable-functions
disable_functions = passthru,exec,system,chroot,chgrp,chown,shell_exec,popen,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv
disable_functions =
; This directive allows you to disable certain classes for security reasons.
; It receives a comma-delimited list of class names.

View File

@ -27,9 +27,9 @@ export EXTENSIONS=",${PHP_EXTENSIONS},"
# specific version.
#
# For example, to check if current php is greater than or
# equal to PHP 8.0:
# equal to PHP 7.0:
#
# isPhpVersionGreaterOrEqual 8 0
# isPhpVersionGreaterOrEqual 7 0
#
# Param 1: Specific PHP Major version
# Param 2: Specific PHP Minor version
@ -62,6 +62,7 @@ installExtensionFromTgz()
tgzName=$1
para1=
extensionName="${tgzName%%-*}"
if [ $2 ]; then
para1=$2
fi
@ -72,6 +73,18 @@ installExtensionFromTgz()
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
# end
if [[ -z "${EXTENSIONS##*,pdo_mysql,*}" ]]; then
echo "---------- Install pdo_mysql ----------"
@ -208,19 +221,9 @@ if [[ -z "${EXTENSIONS##*,hprose,*}" ]]; then
docker-php-ext-enable hprose
fi
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##*,gd,*}" ]]; then
echo "---------- Install gd ----------"
isPhpVersionGreaterOrEqual 8 0
isPhpVersionGreaterOrEqual 7 4
if [[ "$?" = "1" ]]; then
# "--with-xxx-dir" was removed from php 7.4,
@ -389,47 +392,47 @@ fi
if [[ -z "${EXTENSIONS##*,ssh2,*}" ]]; then
isPhpVersionGreaterOrEqual 8 0
isPhpVersionGreaterOrEqual 7 0
if [[ "$?" = "1" ]]; then
echo "---------- Install ssh2 ----------"
printf "\n" | apk add libssh2-dev
pecl install ssh2-1.1.2
docker-php-ext-enable ssh2
else
echo "ssh2 requires PHP >= 8.0.0, installed version is ${PHP_VERSION}"
echo "ssh2 requires PHP >= 7.0.0, installed version is ${PHP_VERSION}"
fi
fi
if [[ -z "${EXTENSIONS##*,protobuf,*}" ]]; then
isPhpVersionGreaterOrEqual 8 0
isPhpVersionGreaterOrEqual 7 0
if [[ "$?" = "1" ]]; then
echo "---------- Install protobuf ----------"
printf "\n" | pecl install protobuf
docker-php-ext-enable protobuf
else
echo "yar requires PHP >= 8.0.0, installed version is ${PHP_VERSION}"
echo "yar requires PHP >= 7.0.0, installed version is ${PHP_VERSION}"
fi
fi
if [[ -z "${EXTENSIONS##*,yac,*}" ]]; then
isPhpVersionGreaterOrEqual 8 0
isPhpVersionGreaterOrEqual 7 0
if [[ "$?" = "1" ]]; then
echo "---------- Install yac ----------"
printf "\n" | pecl install yac-2.0.2
docker-php-ext-enable yac
else
echo "yar requires PHP >= 8.0.0, installed version is ${PHP_VERSION}"
echo "yar requires PHP >= 7.0.0, installed version is ${PHP_VERSION}"
fi
fi
if [[ -z "${EXTENSIONS##*,yar,*}" ]]; then
isPhpVersionGreaterOrEqual 8 0
isPhpVersionGreaterOrEqual 7 0
if [[ "$?" = "1" ]]; then
echo "---------- Install yar ----------"
printf "\n" | pecl install yar
docker-php-ext-enable yar
else
echo "yar requires PHP >= 8.0.0, installed version is ${PHP_VERSION}"
echo "yar requires PHP >= 7.0.0, installed version is ${PHP_VERSION}"
fi
fi
@ -437,13 +440,13 @@ fi
if [[ -z "${EXTENSIONS##*,yaconf,*}" ]]; then
isPhpVersionGreaterOrEqual 8 0
isPhpVersionGreaterOrEqual 7 0
if [[ "$?" = "1" ]]; then
echo "---------- Install yaconf ----------"
printf "\n" | pecl install yaconf
docker-php-ext-enable yaconf
else
echo "yar requires PHP >= 8.0.0, installed version is ${PHP_VERSION}"
echo "yar requires PHP >= 7.0.0, installed version is ${PHP_VERSION}"
fi
fi
@ -461,7 +464,7 @@ if [[ -z "${EXTENSIONS##*,varnish,*}" ]]; then
fi
if [[ -z "${EXTENSIONS##*,pdo_sqlsrv,*}" ]]; then
isPhpVersionGreaterOrEqual 8 0
isPhpVersionGreaterOrEqual 7 1
if [[ "$?" = "1" ]]; then
echo "---------- Install pdo_sqlsrv ----------"
apk add --no-cache unixodbc-dev
@ -470,24 +473,24 @@ if [[ -z "${EXTENSIONS##*,pdo_sqlsrv,*}" ]]; then
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 >= 8.0.0, installed version is ${PHP_VERSION}"
echo "pdo_sqlsrv requires PHP >= 7.1.0, installed version is ${PHP_VERSION}"
fi
fi
if [[ -z "${EXTENSIONS##*,sqlsrv,*}" ]]; then
isPhpVersionGreaterOrEqual 8 0
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 >= 8.0.0, installed version is ${PHP_VERSION}"
echo "pdo_sqlsrv requires PHP >= 7.1.0, installed version is ${PHP_VERSION}"
fi
fi
if [[ -z "${EXTENSIONS##*,mcrypt,*}" ]]; then
isPhpVersionGreaterOrEqual 8 0
isPhpVersionGreaterOrEqual 7 0
if [[ "$?" = "1" ]]; then
echo "---------- Install mcrypt ----------"
apk add --no-cache libmcrypt-dev libmcrypt re2c
@ -501,10 +504,10 @@ if [[ -z "${EXTENSIONS##*,mcrypt,*}" ]]; then
fi
if [[ -z "${EXTENSIONS##*,mysql,*}" ]]; then
isPhpVersionGreaterOrEqual 8 0
isPhpVersionGreaterOrEqual 7 0
if [[ "$?" = "1" ]]; then
echo "---------- mysql was REMOVED from PHP 8.0.0 ----------"
echo "---------- mysql was REMOVED from PHP 7.0.0 ----------"
else
echo "---------- Install mysql ----------"
docker-php-ext-install ${MC} mysql
@ -512,10 +515,10 @@ if [[ -z "${EXTENSIONS##*,mysql,*}" ]]; then
fi
if [[ -z "${EXTENSIONS##*,sodium,*}" ]]; then
isPhpVersionGreaterOrEqual 8 0
isPhpVersionGreaterOrEqual 7 2
if [[ "$?" = "1" ]]; then
echo
echo "Sodium is bundled with PHP from PHP 8.0.0"
echo "Sodium is bundled with PHP from PHP 7.2.0"
echo
else
echo "---------- Install sodium ----------"
@ -526,46 +529,64 @@ fi
if [[ -z "${EXTENSIONS##*,amqp,*}" ]]; then
echo "---------- Install amqp ----------"
apk add --no-cache -U autoconf
apk add --no-cache -U gcc
apk add --no-cache -U linux-headers
apk add --no-cache -U libc-dev
apk add --no-cache --update --virtual .phpize-deps-configure $PHPIZE_DEPS \
&& apk add rabbitmq-c-dev \
&& printf '\n' | pecl install amqp \
&& docker-php-ext-enable amqp \
&& apk del .phpize-deps-configure
apk add --no-cache rabbitmq-c-dev
installExtensionFromTgz amqp-1.10.2
fi
if [[ -z "${EXTENSIONS##*,redis,*}" ]]; then
echo "---------- Install redis ----------"
installExtensionFromTgz redis-5.3.7
isPhpVersionGreaterOrEqual 7 0
if [[ "$?" = "1" ]]; then
installExtensionFromTgz redis-5.2.2
else
printf "\n" | pecl install redis-4.3.0
docker-php-ext-enable redis
fi
fi
if [[ -z "${EXTENSIONS##*,apcu,*}" ]]; then
echo "---------- Install apcu ----------"
pecl install apcu
docker-php-ext-enable apcu
installExtensionFromTgz apcu-5.1.17
fi
if [[ -z "${EXTENSIONS##*,memcached,*}" ]]; then
echo "---------- Install memcached ----------"
apk add --no-cache libmemcached-dev zlib-dev
pecl install memcached-3.2.3
isPhpVersionGreaterOrEqual 7 0
if [[ "$?" = "1" ]]; then
printf "\n" | pecl install memcached-3.1.3
else
printf "\n" | pecl install memcached-2.2.0
fi
docker-php-ext-enable memcached
fi
if [[ -z "${EXTENSIONS##*,memcache,*}" ]]; then
echo "---------- Install memcache ----------"
pecl install memcache
docker-php-ext-enable memcache
isPhpVersionGreaterOrEqual 7 0
if [[ "$?" = "1" ]]; then
installExtensionFromTgz memcache-4.0.5.2
else
installExtensionFromTgz memcache-2.2.6
fi
fi
if [[ -z "${EXTENSIONS##*,xdebug,*}" ]]; then
echo "---------- Install xdebug ----------"
installExtensionFromTgz xdebug-3.2.0
isPhpVersionGreaterOrEqual 7 0
if [[ "$?" = "1" ]]; then
isPhpVersionGreaterOrEqual 7 4
if [[ "$?" = "1" ]]; then
installExtensionFromTgz xdebug-2.9.2
else
installExtensionFromTgz xdebug-2.6.1
fi
else
installExtensionFromTgz xdebug-2.5.5
fi
fi
if [[ -z "${EXTENSIONS##*,event,*}" ]]; then
@ -579,27 +600,38 @@ if [[ -z "${EXTENSIONS##*,event,*}" ]]; then
fi
echo "---------- Install event again ----------"
installExtensionFromTgz event-3.0.5 "--ini-name event.ini"
installExtensionFromTgz event-2.5.6 "--ini-name event.ini"
fi
if [[ -z "${EXTENSIONS##*,mongodb,*}" ]]; then
echo "---------- Install mongodb ----------"
pecl install mongodb
docker-php-ext-enable mongodb
installExtensionFromTgz mongodb-1.7.4
fi
if [[ -z "${EXTENSIONS##*,yaf,*}" ]]; then
echo "---------- Install yaf ----------"
pecl install yaf
isPhpVersionGreaterOrEqual 7 0
if [[ "$?" = "1" ]]; then
printf "\n" | pecl install yaf
docker-php-ext-enable yaf
else
installExtensionFromTgz yaf-2.3.5
fi
fi
if [[ -z "${EXTENSIONS##*,swoole,*}" ]]; then
echo "---------- Install swoole ----------"
isPhpVersionGreaterOrEqual 8 0
# Fix: Refer to the line containing "swoole@alpine)" in file "./install-php-extensions"
apk add --no-cache libstdc++
isPhpVersionGreaterOrEqual 7 0
if [[ "$?" = "1" ]]; then
installExtensionFromTgz swoole-5.0.2 --enable-openssl
installExtensionFromTgz swoole-4.5.2
else
installExtensionFromTgz swoole-2.0.11
fi
fi
@ -608,7 +640,7 @@ if [[ -z "${EXTENSIONS##*,zip,*}" ]]; then
# Fix: https://github.com/docker-library/php/issues/797
apk add --no-cache libzip-dev
isPhpVersionGreaterOrEqual 8 0
isPhpVersionGreaterOrEqual 7 4
if [[ "$?" != "1" ]]; then
docker-php-ext-configure zip --with-libzip=/usr/include
fi
@ -618,39 +650,48 @@ fi
if [[ -z "${EXTENSIONS##*,xhprof,*}" ]]; then
echo "---------- Install XHProf ----------"
pecl install xhprof
docker-php-ext-enable xhprof
isPhpVersionGreaterOrEqual 7 0
if [[ "$?" = "1" ]]; then
mkdir xhprof \
&& tar -xf xhprof-2.2.0.tgz -C xhprof --strip-components=1 \
&& ( cd xhprof/extension/ && phpize && ./configure && make ${MC} && make install ) \
&& docker-php-ext-enable xhprof
else
echo "---------- PHP Version>= 7.0----------"
fi
fi
if [[ -z "${EXTENSIONS##*,xlswriter,*}" ]]; then
echo "---------- Install xlswriter ----------"
isPhpVersionGreaterOrEqual 8 0
isPhpVersionGreaterOrEqual 7 0
if [[ "$?" = "1" ]]; then
printf "\n" | pecl install xlswriter
docker-php-ext-enable xlswriter
else
echo "---------- PHP Version>= 8.0----------"
echo "---------- PHP Version>= 7.0----------"
fi
fi
if [[ -z "${EXTENSIONS##*,rdkafka,*}" ]]; then
echo "---------- Install rdkafka ----------"
isPhpVersionGreaterOrEqual 8 0
isPhpVersionGreaterOrEqual 5 6
if [[ "$?" = "1" ]]; then
apk add librdkafka-dev
printf "\n" | pecl install rdkafka
docker-php-ext-enable rdkafka
else
echo "---------- PHP Version>= 8.0----------"
echo "---------- PHP Version>= 5.6----------"
fi
fi
if [[ -z "${EXTENSIONS##*,zookeeper,*}" ]]; then
echo "---------- Install zookeeper ----------"
isPhpVersionGreaterOrEqual 8 0
isPhpVersionGreaterOrEqual 7 0
if [[ "$?" = "1" ]]; then
apk add re2c
@ -658,26 +699,26 @@ if [[ -z "${EXTENSIONS##*,zookeeper,*}" ]]; then
printf "\n" | pecl install zookeeper
docker-php-ext-enable zookeeper
else
echo "---------- PHP Version>= 8.0----------"
echo "---------- PHP Version>= 7.0----------"
fi
fi
if [[ -z "${EXTENSIONS##*,phalcon,*}" ]]; then
echo "---------- Install phalcon ----------"
isPhpVersionGreaterOrEqual 8 0
isPhpVersionGreaterOrEqual 7 2
if [[ "$?" = "1" ]]; then
printf "\n" | pecl install phalcon
docker-php-ext-enable psr
docker-php-ext-enable phalcon
else
echo "---------- PHP Version>= 8.0----------"
echo "---------- PHP Version>= 7.2----------"
fi
fi
if [[ -z "${EXTENSIONS##*,sdebug,*}" ]]; then
echo "---------- Install sdebug ----------"
isPhpVersionGreaterOrEqual 8 0
isPhpVersionGreaterOrEqual 7 2
if [[ "$?" = "1" ]]; then
curl -SL "https://github.com/swoole/sdebug/archive/sdebug_2_9-beta.tar.gz" -o sdebug.tar.gz \
@ -692,7 +733,7 @@ if [[ -z "${EXTENSIONS##*,sdebug,*}" ]]; then
) \
&& docker-php-ext-enable xdebug
else
echo "---------- PHP Version>= 8.0----------"
echo "---------- PHP Version>= 7.2----------"
fi
fi

View File

@ -311,7 +311,7 @@ serialize_precision = -1
; This directive allows you to disable certain functions for security reasons.
; It receives a comma-delimited list of function names.
; http://php.net/disable-functions
disable_functions = passthru,exec,system,chroot,chgrp,chown,shell_exec,popen,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv
disable_functions =
; This directive allows you to disable certain classes for security reasons.
; It receives a comma-delimited list of class names.

View File

@ -311,7 +311,7 @@ serialize_precision = -1
; This directive allows you to disable certain functions for security reasons.
; It receives a comma-delimited list of function names.
; http://php.net/disable-functions
disable_functions = passthru,exec,system,chroot,chgrp,chown,shell_exec,popen,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv
disable_functions =
; This directive allows you to disable certain classes for security reasons.
; It receives a comma-delimited list of class names.

View File

@ -311,7 +311,7 @@ serialize_precision = -1
; This directive allows you to disable certain functions for security reasons.
; It receives a comma-delimited list of function names.
; http://php.net/disable-functions
disable_functions = passthru,exec,system,chroot,chgrp,chown,shell_exec,popen,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv
disable_functions =
; This directive allows you to disable certain classes for security reasons.
; It receives a comma-delimited list of class names.

View File

@ -311,7 +311,7 @@ serialize_precision = -1
; This directive allows you to disable certain functions for security reasons.
; It receives a comma-delimited list of function names.
; http://php.net/disable-functions
disable_functions = passthru,exec,system,chroot,chgrp,chown,shell_exec,popen,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv
disable_functions =
; This directive allows you to disable certain classes for security reasons.
; It receives a comma-delimited list of class names.