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. ; This directive allows you to disable certain functions for security reasons.
; It receives a comma-delimited list of function names. ; It receives a comma-delimited list of function names.
; http://php.net/disable-functions ; 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. ; This directive allows you to disable certain classes for security reasons.
; It receives a comma-delimited list of class names. ; 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. ; This directive allows you to disable certain functions for security reasons.
; It receives a comma-delimited list of function names. ; It receives a comma-delimited list of function names.
; http://php.net/disable-functions ; 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. ; This directive allows you to disable certain classes for security reasons.
; It receives a comma-delimited list of class names. ; 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. ; This directive allows you to disable certain functions for security reasons.
; It receives a comma-delimited list of function names. ; It receives a comma-delimited list of function names.
; http://php.net/disable-functions ; 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. ; This directive allows you to disable certain classes for security reasons.
; It receives a comma-delimited list of class names. ; It receives a comma-delimited list of class names.

View File

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

View File

@ -311,7 +311,7 @@ serialize_precision = -1
; This directive allows you to disable certain functions for security reasons. ; This directive allows you to disable certain functions for security reasons.
; It receives a comma-delimited list of function names. ; It receives a comma-delimited list of function names.
; http://php.net/disable-functions ; 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. ; This directive allows you to disable certain classes for security reasons.
; It receives a comma-delimited list of class names. ; It receives a comma-delimited list of class names.

View File

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

View File

@ -311,7 +311,7 @@ serialize_precision = -1
; This directive allows you to disable certain functions for security reasons. ; This directive allows you to disable certain functions for security reasons.
; It receives a comma-delimited list of function names. ; It receives a comma-delimited list of function names.
; http://php.net/disable-functions ; 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. ; This directive allows you to disable certain classes for security reasons.
; It receives a comma-delimited list of class names. ; It receives a comma-delimited list of class names.

View File

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

View File

@ -311,7 +311,7 @@ serialize_precision = -1
; This directive allows you to disable certain functions for security reasons. ; This directive allows you to disable certain functions for security reasons.
; It receives a comma-delimited list of function names. ; It receives a comma-delimited list of function names.
; http://php.net/disable-functions ; 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. ; This directive allows you to disable certain classes for security reasons.
; It receives a comma-delimited list of class names. ; It receives a comma-delimited list of class names.

View File

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

View File

@ -311,7 +311,7 @@ serialize_precision = -1
; This directive allows you to disable certain functions for security reasons. ; This directive allows you to disable certain functions for security reasons.
; It receives a comma-delimited list of function names. ; It receives a comma-delimited list of function names.
; http://php.net/disable-functions ; 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. ; This directive allows you to disable certain classes for security reasons.
; It receives a comma-delimited list of class names. ; It receives a comma-delimited list of class names.

View File

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

View File

@ -311,7 +311,7 @@ serialize_precision = -1
; This directive allows you to disable certain functions for security reasons. ; This directive allows you to disable certain functions for security reasons.
; It receives a comma-delimited list of function names. ; It receives a comma-delimited list of function names.
; http://php.net/disable-functions ; 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. ; This directive allows you to disable certain classes for security reasons.
; It receives a comma-delimited list of class names. ; 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. ; This directive allows you to disable certain functions for security reasons.
; It receives a comma-delimited list of function names. ; It receives a comma-delimited list of function names.
; http://php.net/disable-functions ; 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. ; This directive allows you to disable certain classes for security reasons.
; It receives a comma-delimited list of class names. ; 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. ; This directive allows you to disable certain functions for security reasons.
; It receives a comma-delimited list of function names. ; It receives a comma-delimited list of function names.
; http://php.net/disable-functions ; 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. ; This directive allows you to disable certain classes for security reasons.
; It receives a comma-delimited list of class names. ; 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. ; This directive allows you to disable certain functions for security reasons.
; It receives a comma-delimited list of function names. ; It receives a comma-delimited list of function names.
; http://php.net/disable-functions ; 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. ; This directive allows you to disable certain classes for security reasons.
; It receives a comma-delimited list of class names. ; It receives a comma-delimited list of class names.