2023-09-11 17:54:21 +08:00
|
|
|
#!/bin/bash
|
2023-04-09 10:55:06 +08:00
|
|
|
|
|
|
|
echo
|
|
|
|
echo "============================================"
|
|
|
|
echo "Install extensions from : install.sh"
|
|
|
|
echo "PHP version : ${PHP_VERSION}"
|
2023-09-11 17:54:21 +08:00
|
|
|
echo "Install extensions : ${PHP_EXTENSIONS}"
|
|
|
|
echo "Multicore compilation : ${MC}"
|
2023-04-09 10:55:06 +08:00
|
|
|
echo "Container package url : ${CONTAINER_PACKAGE_URL}"
|
|
|
|
echo "Work directory : ${PWD}"
|
|
|
|
echo "============================================"
|
|
|
|
echo
|
|
|
|
|
|
|
|
|
2023-09-11 17:54:21 +08:00
|
|
|
echo "---------- Install zip extension ----------"
|
|
|
|
apt-get install -y zlib1g-dev unzip
|
|
|
|
docker-php-ext-install zip
|
2023-04-09 10:55:06 +08:00
|
|
|
|
|
|
|
installExtensionFromTgz()
|
|
|
|
{
|
|
|
|
tgzName=$1
|
|
|
|
extensionName="${tgzName%%-*}"
|
2023-09-11 17:54:21 +08:00
|
|
|
|
2023-04-09 10:55:06 +08:00
|
|
|
mkdir ${extensionName}
|
|
|
|
tar -xf ${tgzName}.tgz -C ${extensionName} --strip-components=1
|
2023-09-11 17:54:21 +08:00
|
|
|
( cd ${extensionName} && phpize && ./configure && make ${MC} && make install )
|
2023-04-09 10:55:06 +08:00
|
|
|
|
2023-09-11 17:54:21 +08:00
|
|
|
docker-php-ext-enable ${extensionName} $2
|
2023-04-09 10:55:06 +08:00
|
|
|
}
|
|
|
|
|
2023-09-11 17:54:21 +08:00
|
|
|
export EXTENSIONS=",${PHP_EXTENSIONS},"
|
2023-04-09 10:55:06 +08:00
|
|
|
|
2023-09-11 17:54:21 +08:00
|
|
|
if [ -z "${EXTENSIONS##*,gd,*}" ]; then
|
|
|
|
echo "---------- Install gd ----------"
|
|
|
|
apt-get install -y libfreetype6-dev libjpeg62-turbo-dev libpng-dev \
|
|
|
|
&& docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \
|
|
|
|
&& docker-php-ext-install gd
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -z "${EXTENSIONS##*,pdo_mysql,*}" ]; then
|
2023-04-09 10:55:06 +08:00
|
|
|
echo "---------- Install pdo_mysql ----------"
|
2023-09-11 17:54:21 +08:00
|
|
|
docker-php-ext-install pdo_mysql
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -z "${EXTENSIONS##*,intl,*}" ]; then
|
|
|
|
echo "---------- Install intl ----------"
|
|
|
|
apt-get install -y libicu-dev
|
|
|
|
docker-php-ext-install intl
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -z "${EXTENSIONS##*,bz2,*}" ]; then
|
|
|
|
echo "---------- Install bz2 ----------"
|
|
|
|
apt-get install -y libbz2-dev
|
|
|
|
docker-php-ext-install bz2
|
2023-04-09 10:55:06 +08:00
|
|
|
fi
|
|
|
|
|
2023-09-11 17:54:21 +08:00
|
|
|
if [ -z "${EXTENSIONS##*,pcntl,*}" ]; then
|
2023-04-09 10:55:06 +08:00
|
|
|
echo "---------- Install pcntl ----------"
|
2023-09-11 17:54:21 +08:00
|
|
|
docker-php-ext-install pcntl
|
2023-04-09 10:55:06 +08:00
|
|
|
fi
|
|
|
|
|
2023-09-11 17:54:21 +08:00
|
|
|
if [ -z "${EXTENSIONS##*,mysqli,*}" ]; then
|
2023-04-09 10:55:06 +08:00
|
|
|
echo "---------- Install mysqli ----------"
|
2023-09-11 17:54:21 +08:00
|
|
|
docker-php-ext-install mysqli
|
2023-04-09 10:55:06 +08:00
|
|
|
fi
|
|
|
|
|
2023-09-11 17:54:21 +08:00
|
|
|
if [ -z "${EXTENSIONS##*,mbstring,*}" ]; then
|
|
|
|
echo "---------- Install mbstring ----------"
|
|
|
|
docker-php-ext-install mbstring
|
2023-04-09 10:55:06 +08:00
|
|
|
fi
|
|
|
|
|
2023-09-11 17:54:21 +08:00
|
|
|
if [ -z "${EXTENSIONS##*,exif,*}" ]; then
|
2023-04-09 10:55:06 +08:00
|
|
|
echo "---------- Install exif ----------"
|
2023-09-11 17:54:21 +08:00
|
|
|
docker-php-ext-install exif
|
2023-04-09 10:55:06 +08:00
|
|
|
fi
|
|
|
|
|
2023-09-11 17:54:21 +08:00
|
|
|
if [ -z "${EXTENSIONS##*,bcmath,*}" ]; then
|
2023-04-09 10:55:06 +08:00
|
|
|
echo "---------- Install bcmath ----------"
|
2023-09-11 17:54:21 +08:00
|
|
|
docker-php-ext-install bcmath
|
2023-04-09 10:55:06 +08:00
|
|
|
fi
|
|
|
|
|
2023-09-11 17:54:21 +08:00
|
|
|
if [ -z "${EXTENSIONS##*,calendar,*}" ]; then
|
2023-04-09 10:55:06 +08:00
|
|
|
echo "---------- Install calendar ----------"
|
2023-09-11 17:54:21 +08:00
|
|
|
docker-php-ext-install calendar
|
2023-04-09 10:55:06 +08:00
|
|
|
fi
|
|
|
|
|
2023-09-11 17:54:21 +08:00
|
|
|
if [ -z "${EXTENSIONS##*,sockets,*}" ]; then
|
2023-04-09 10:55:06 +08:00
|
|
|
echo "---------- Install sockets ----------"
|
2023-09-11 17:54:21 +08:00
|
|
|
docker-php-ext-install sockets
|
2023-04-09 10:55:06 +08:00
|
|
|
fi
|
|
|
|
|
2023-09-11 17:54:21 +08:00
|
|
|
if [ -z "${EXTENSIONS##*,gettext,*}" ]; then
|
2023-04-09 10:55:06 +08:00
|
|
|
echo "---------- Install gettext ----------"
|
2023-09-11 17:54:21 +08:00
|
|
|
docker-php-ext-install gettext
|
2023-04-09 10:55:06 +08:00
|
|
|
fi
|
|
|
|
|
2023-09-11 17:54:21 +08:00
|
|
|
if [ -z "${EXTENSIONS##*,shmop,*}" ]; then
|
2023-04-09 10:55:06 +08:00
|
|
|
echo "---------- Install shmop ----------"
|
2023-09-11 17:54:21 +08:00
|
|
|
docker-php-ext-install shmop
|
2023-04-09 10:55:06 +08:00
|
|
|
fi
|
|
|
|
|
2023-09-11 17:54:21 +08:00
|
|
|
if [ -z "${EXTENSIONS##*,sysvmsg,*}" ]; then
|
2023-04-09 10:55:06 +08:00
|
|
|
echo "---------- Install sysvmsg ----------"
|
2023-09-11 17:54:21 +08:00
|
|
|
docker-php-ext-install sysvmsg
|
2023-04-09 10:55:06 +08:00
|
|
|
fi
|
|
|
|
|
2023-09-11 17:54:21 +08:00
|
|
|
if [ -z "${EXTENSIONS##*,sysvsem,*}" ]; then
|
2023-04-09 10:55:06 +08:00
|
|
|
echo "---------- Install sysvsem ----------"
|
2023-09-11 17:54:21 +08:00
|
|
|
docker-php-ext-install sysvsem
|
2023-04-09 10:55:06 +08:00
|
|
|
fi
|
|
|
|
|
2023-09-11 17:54:21 +08:00
|
|
|
if [ -z "${EXTENSIONS##*,sysvshm,*}" ]; then
|
2023-04-09 10:55:06 +08:00
|
|
|
echo "---------- Install sysvshm ----------"
|
2023-09-11 17:54:21 +08:00
|
|
|
docker-php-ext-install sysvshm
|
2023-04-09 10:55:06 +08:00
|
|
|
fi
|
|
|
|
|
2023-09-11 17:54:21 +08:00
|
|
|
if [ -z "${EXTENSIONS##*,pdo_firebird,*}" ]; then
|
2023-04-09 10:55:06 +08:00
|
|
|
echo "---------- Install pdo_firebird ----------"
|
2023-09-11 17:54:21 +08:00
|
|
|
docker-php-ext-install pdo_firebird
|
2023-04-09 10:55:06 +08:00
|
|
|
fi
|
|
|
|
|
2023-09-11 17:54:21 +08:00
|
|
|
if [ -z "${EXTENSIONS##*,pdo_dblib,*}" ]; then
|
2023-04-09 10:55:06 +08:00
|
|
|
echo "---------- Install pdo_dblib ----------"
|
2023-09-11 17:54:21 +08:00
|
|
|
docker-php-ext-install pdo_dblib
|
2023-04-09 10:55:06 +08:00
|
|
|
fi
|
|
|
|
|
2023-09-11 17:54:21 +08:00
|
|
|
if [ -z "${EXTENSIONS##*,pdo_oci,*}" ]; then
|
2023-04-09 10:55:06 +08:00
|
|
|
echo "---------- Install pdo_oci ----------"
|
2023-09-11 17:54:21 +08:00
|
|
|
docker-php-ext-install pdo_oci
|
2023-04-09 10:55:06 +08:00
|
|
|
fi
|
|
|
|
|
2023-09-11 17:54:21 +08:00
|
|
|
if [ -z "${EXTENSIONS##*,pdo_odbc,*}" ]; then
|
2023-04-09 10:55:06 +08:00
|
|
|
echo "---------- Install pdo_odbc ----------"
|
2023-09-11 17:54:21 +08:00
|
|
|
docker-php-ext-install pdo_odbc
|
2023-04-09 10:55:06 +08:00
|
|
|
fi
|
|
|
|
|
2023-09-11 17:54:21 +08:00
|
|
|
if [ -z "${EXTENSIONS##*,pdo_pgsql,*}" ]; then
|
2023-04-09 10:55:06 +08:00
|
|
|
echo "---------- Install pdo_pgsql ----------"
|
2023-09-11 17:54:21 +08:00
|
|
|
docker-php-ext-install pdo_pgsql
|
2023-04-09 10:55:06 +08:00
|
|
|
fi
|
|
|
|
|
2023-09-11 17:54:21 +08:00
|
|
|
if [ -z "${EXTENSIONS##*,pgsql,*}" ]; then
|
2023-04-09 10:55:06 +08:00
|
|
|
echo "---------- Install pgsql ----------"
|
2023-09-11 17:54:21 +08:00
|
|
|
docker-php-ext-install pgsql
|
2023-04-09 10:55:06 +08:00
|
|
|
fi
|
|
|
|
|
2023-09-11 17:54:21 +08:00
|
|
|
if [ -z "${EXTENSIONS##*,oci8,*}" ]; then
|
2023-04-09 10:55:06 +08:00
|
|
|
echo "---------- Install oci8 ----------"
|
2023-09-11 17:54:21 +08:00
|
|
|
docker-php-ext-install oci8
|
2023-04-09 10:55:06 +08:00
|
|
|
fi
|
|
|
|
|
2023-09-11 17:54:21 +08:00
|
|
|
if [ -z "${EXTENSIONS##*,odbc,*}" ]; then
|
2023-04-09 10:55:06 +08:00
|
|
|
echo "---------- Install odbc ----------"
|
2023-09-11 17:54:21 +08:00
|
|
|
docker-php-ext-install odbc
|
2023-04-09 10:55:06 +08:00
|
|
|
fi
|
|
|
|
|
2023-09-11 17:54:21 +08:00
|
|
|
if [ -z "${EXTENSIONS##*,dba,*}" ]; then
|
2023-04-09 10:55:06 +08:00
|
|
|
echo "---------- Install dba ----------"
|
2023-09-11 17:54:21 +08:00
|
|
|
docker-php-ext-install dba
|
2023-04-09 10:55:06 +08:00
|
|
|
fi
|
|
|
|
|
2023-09-11 17:54:21 +08:00
|
|
|
if [ -z "${EXTENSIONS##*,interbase,*}" ]; then
|
2023-04-09 10:55:06 +08:00
|
|
|
echo "---------- Install interbase ----------"
|
2023-09-11 17:54:21 +08:00
|
|
|
docker-php-ext-install interbase
|
2023-04-09 10:55:06 +08:00
|
|
|
fi
|
|
|
|
|
2023-09-11 17:54:21 +08:00
|
|
|
if [ -z "${EXTENSIONS##*,soap,*}" ]; then
|
2023-04-09 10:55:06 +08:00
|
|
|
echo "---------- Install soap ----------"
|
2023-09-11 17:54:21 +08:00
|
|
|
apt-get install -y libxml2-dev
|
|
|
|
docker-php-ext-install soap
|
2023-04-09 10:55:06 +08:00
|
|
|
fi
|
|
|
|
|
2023-09-11 17:54:21 +08:00
|
|
|
|
|
|
|
if [ -z "${EXTENSIONS##*,xsl,*}" ]; then
|
2023-04-09 10:55:06 +08:00
|
|
|
echo "---------- Install xsl ----------"
|
2023-09-11 17:54:21 +08:00
|
|
|
apt-get install -y libxml2-dev
|
|
|
|
apt-get install -y libxslt-dev
|
|
|
|
docker-php-ext-install xsl
|
2023-04-09 10:55:06 +08:00
|
|
|
fi
|
|
|
|
|
2023-09-11 17:54:21 +08:00
|
|
|
if [ -z "${EXTENSIONS##*,xmlrpc,*}" ]; then
|
2023-04-09 10:55:06 +08:00
|
|
|
echo "---------- Install xmlrpc ----------"
|
2023-09-11 17:54:21 +08:00
|
|
|
apt-get install -y libxml2-dev
|
|
|
|
apt-get install -y libxslt-dev
|
|
|
|
docker-php-ext-install xmlrpc
|
2023-04-09 10:55:06 +08:00
|
|
|
fi
|
|
|
|
|
2023-09-11 17:54:21 +08:00
|
|
|
if [ -z "${EXTENSIONS##*,wddx,*}" ]; then
|
2023-04-09 10:55:06 +08:00
|
|
|
echo "---------- Install wddx ----------"
|
2023-09-11 17:54:21 +08:00
|
|
|
apt-get install -y libxml2-dev
|
|
|
|
apt-get install -y libxslt-dev
|
|
|
|
docker-php-ext-install wddx
|
2023-04-09 10:55:06 +08:00
|
|
|
fi
|
|
|
|
|
2023-09-11 17:54:21 +08:00
|
|
|
if [ -z "${EXTENSIONS##*,curl,*}" ]; then
|
|
|
|
echo "---------- Install curl ----------"
|
|
|
|
apt-get install -y curl
|
|
|
|
apt-get install -y libcurl3
|
|
|
|
apt-get install -y libcurl4-openssl-dev
|
|
|
|
docker-php-ext-install curl
|
2023-04-09 10:55:06 +08:00
|
|
|
fi
|
|
|
|
|
2023-09-11 17:54:21 +08:00
|
|
|
if [ -z "${EXTENSIONS##*,readline,*}" ]; then
|
2023-04-09 10:55:06 +08:00
|
|
|
echo "---------- Install readline ----------"
|
2023-09-11 17:54:21 +08:00
|
|
|
apt-get install -y libreadline-dev
|
|
|
|
docker-php-ext-install readline
|
2023-04-09 10:55:06 +08:00
|
|
|
fi
|
|
|
|
|
2023-09-11 17:54:21 +08:00
|
|
|
if [ -z "${EXTENSIONS##*,snmp,*}" ]; then
|
2023-04-09 10:55:06 +08:00
|
|
|
echo "---------- Install snmp ----------"
|
2023-09-11 17:54:21 +08:00
|
|
|
apt-get install -y libsnmp-dev
|
|
|
|
apt-get install -y snmp
|
|
|
|
docker-php-ext-install snmp
|
2023-04-09 10:55:06 +08:00
|
|
|
fi
|
|
|
|
|
2023-09-11 17:54:21 +08:00
|
|
|
if [ -z "${EXTENSIONS##*,pspell,*}" ]; then
|
2023-04-09 10:55:06 +08:00
|
|
|
echo "---------- Install pspell ----------"
|
2023-09-11 17:54:21 +08:00
|
|
|
apt-get install -y libpspell-dev
|
|
|
|
apt-get install -y aspell-en
|
|
|
|
docker-php-ext-install pspell
|
2023-04-09 10:55:06 +08:00
|
|
|
fi
|
|
|
|
|
2023-09-11 17:54:21 +08:00
|
|
|
if [ -z "${EXTENSIONS##*,recode,*}" ]; then
|
2023-04-09 10:55:06 +08:00
|
|
|
echo "---------- Install recode ----------"
|
2023-09-11 17:54:21 +08:00
|
|
|
apt-get install -y librecode0
|
|
|
|
apt-get install -y librecode-dev
|
|
|
|
docker-php-ext-install recode
|
2023-04-09 10:55:06 +08:00
|
|
|
fi
|
|
|
|
|
2023-09-11 17:54:21 +08:00
|
|
|
if [ -z "${EXTENSIONS##*,tidy,*}" ]; then
|
2023-04-09 10:55:06 +08:00
|
|
|
echo "---------- Install tidy ----------"
|
2023-09-11 17:54:21 +08:00
|
|
|
apt-get install -y libtidy-dev
|
|
|
|
docker-php-ext-install tidy
|
2023-04-09 10:55:06 +08:00
|
|
|
fi
|
|
|
|
|
2023-09-11 17:54:21 +08:00
|
|
|
if [ -z "${EXTENSIONS##*,gmp,*}" ]; then
|
2023-04-09 10:55:06 +08:00
|
|
|
echo "---------- Install gmp ----------"
|
2023-09-11 17:54:21 +08:00
|
|
|
apt-get install -y libgmp-dev
|
|
|
|
ln -s /usr/include/x86_64-linux-gnu/gmp.h /usr/include/gmp.h
|
|
|
|
docker-php-ext-install gmp
|
2023-04-09 10:55:06 +08:00
|
|
|
fi
|
|
|
|
|
2023-09-11 17:54:21 +08:00
|
|
|
if [ -z "${EXTENSIONS##*,imap,*}" ]; then
|
2023-04-09 10:55:06 +08:00
|
|
|
echo "---------- Install imap ----------"
|
2023-09-11 17:54:21 +08:00
|
|
|
apt-get install -y libc-client-dev
|
|
|
|
docker-php-ext-configure imap --with-kerberos --with-imap-ssl
|
|
|
|
docker-php-ext-install imap
|
2023-04-09 10:55:06 +08:00
|
|
|
fi
|
|
|
|
|
2023-09-11 17:54:21 +08:00
|
|
|
if [ -z "${EXTENSIONS##*,ldap,*}" ]; then
|
2023-04-09 10:55:06 +08:00
|
|
|
echo "---------- Install ldap ----------"
|
2023-09-11 17:54:21 +08:00
|
|
|
apt-get install -y libldb-dev
|
|
|
|
apt-get install -y libldap2-dev
|
|
|
|
docker-php-ext-configure ldap --with-libdir=lib/x86_64-linux-gnu
|
|
|
|
docker-php-ext-install ldap
|
2023-04-09 10:55:06 +08:00
|
|
|
fi
|
|
|
|
|
2023-09-11 17:54:21 +08:00
|
|
|
if [ -z "${EXTENSIONS##*,imagick,*}" ]; then
|
2023-04-09 10:55:06 +08:00
|
|
|
echo "---------- Install imagick ----------"
|
2023-09-11 17:54:21 +08:00
|
|
|
apt-get install -y libmagickwand-dev
|
|
|
|
pecl install imagick-3.4.3
|
2023-04-09 10:55:06 +08:00
|
|
|
docker-php-ext-enable imagick
|
|
|
|
fi
|
|
|
|
|
2023-09-11 17:54:21 +08:00
|
|
|
if [ -z "${EXTENSIONS##*,memcached,*}" ]; then
|
2023-04-09 10:55:06 +08:00
|
|
|
echo "---------- Install memcached ----------"
|
2023-09-11 17:54:21 +08:00
|
|
|
apt-get install -y libmemcached-dev
|
|
|
|
pecl install memcached-2.2.0
|
2023-04-09 10:55:06 +08:00
|
|
|
docker-php-ext-enable memcached
|
|
|
|
fi
|
|
|
|
|
2023-09-11 17:54:21 +08:00
|
|
|
if [ -z "${EXTENSIONS##*,sqlsrv,*}" ]; then
|
|
|
|
echo "---------- Install sqlsrv ----------"
|
|
|
|
apt-get install -y unixodbc-dev
|
|
|
|
pecl install sqlsrv
|
|
|
|
docker-php-ext-enable sqlsrv
|
2023-04-09 10:55:06 +08:00
|
|
|
fi
|
|
|
|
|
2023-09-11 17:54:21 +08:00
|
|
|
if [ -z "${EXTENSIONS##*,pdo_sqlsrv,*}" ]; then
|
|
|
|
echo "---------- Install pdo_sqlsrv ----------"
|
|
|
|
apt-get install -y unixodbc-dev
|
|
|
|
pecl install pdo_sqlsrv
|
|
|
|
docker-php-ext-enable pdo_sqlsrv
|
2023-04-09 10:55:06 +08:00
|
|
|
fi
|
|
|
|
|
2023-09-11 17:54:21 +08:00
|
|
|
if [ -z "${EXTENSIONS##*,redis,*}" ]; then
|
|
|
|
echo "---------- Install redis ----------"
|
|
|
|
installExtensionFromTgz redis-4.1.1
|
2023-04-09 10:55:06 +08:00
|
|
|
fi
|