appstore-1panel/apps/php5/5.4.45/build/php/extensions/install.sh

290 lines
7.7 KiB
Bash
Raw Normal View History

#!/bin/bash
2023-04-09 10:55:06 +08:00
echo
echo "============================================"
echo "Install extensions from : install.sh"
echo "PHP version : ${PHP_VERSION}"
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
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-04-09 10:55:06 +08:00
mkdir ${extensionName}
tar -xf ${tgzName}.tgz -C ${extensionName} --strip-components=1
( cd ${extensionName} && phpize && ./configure && make ${MC} && make install )
2023-04-09 10:55:06 +08:00
docker-php-ext-enable ${extensionName} $2
2023-04-09 10:55:06 +08:00
}
export EXTENSIONS=",${PHP_EXTENSIONS},"
2023-04-09 10:55:06 +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 ----------"
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
if [ -z "${EXTENSIONS##*,pcntl,*}" ]; then
2023-04-09 10:55:06 +08:00
echo "---------- Install pcntl ----------"
docker-php-ext-install pcntl
2023-04-09 10:55:06 +08:00
fi
if [ -z "${EXTENSIONS##*,mysqli,*}" ]; then
2023-04-09 10:55:06 +08:00
echo "---------- Install mysqli ----------"
docker-php-ext-install mysqli
2023-04-09 10:55:06 +08:00
fi
if [ -z "${EXTENSIONS##*,mbstring,*}" ]; then
echo "---------- Install mbstring ----------"
docker-php-ext-install mbstring
2023-04-09 10:55:06 +08:00
fi
if [ -z "${EXTENSIONS##*,exif,*}" ]; then
2023-04-09 10:55:06 +08:00
echo "---------- Install exif ----------"
docker-php-ext-install exif
2023-04-09 10:55:06 +08:00
fi
if [ -z "${EXTENSIONS##*,bcmath,*}" ]; then
2023-04-09 10:55:06 +08:00
echo "---------- Install bcmath ----------"
docker-php-ext-install bcmath
2023-04-09 10:55:06 +08:00
fi
if [ -z "${EXTENSIONS##*,calendar,*}" ]; then
2023-04-09 10:55:06 +08:00
echo "---------- Install calendar ----------"
docker-php-ext-install calendar
2023-04-09 10:55:06 +08:00
fi
if [ -z "${EXTENSIONS##*,sockets,*}" ]; then
2023-04-09 10:55:06 +08:00
echo "---------- Install sockets ----------"
docker-php-ext-install sockets
2023-04-09 10:55:06 +08:00
fi
if [ -z "${EXTENSIONS##*,gettext,*}" ]; then
2023-04-09 10:55:06 +08:00
echo "---------- Install gettext ----------"
docker-php-ext-install gettext
2023-04-09 10:55:06 +08:00
fi
if [ -z "${EXTENSIONS##*,shmop,*}" ]; then
2023-04-09 10:55:06 +08:00
echo "---------- Install shmop ----------"
docker-php-ext-install shmop
2023-04-09 10:55:06 +08:00
fi
if [ -z "${EXTENSIONS##*,sysvmsg,*}" ]; then
2023-04-09 10:55:06 +08:00
echo "---------- Install sysvmsg ----------"
docker-php-ext-install sysvmsg
2023-04-09 10:55:06 +08:00
fi
if [ -z "${EXTENSIONS##*,sysvsem,*}" ]; then
2023-04-09 10:55:06 +08:00
echo "---------- Install sysvsem ----------"
docker-php-ext-install sysvsem
2023-04-09 10:55:06 +08:00
fi
if [ -z "${EXTENSIONS##*,sysvshm,*}" ]; then
2023-04-09 10:55:06 +08:00
echo "---------- Install sysvshm ----------"
docker-php-ext-install sysvshm
2023-04-09 10:55:06 +08:00
fi
if [ -z "${EXTENSIONS##*,pdo_firebird,*}" ]; then
2023-04-09 10:55:06 +08:00
echo "---------- Install pdo_firebird ----------"
docker-php-ext-install pdo_firebird
2023-04-09 10:55:06 +08:00
fi
if [ -z "${EXTENSIONS##*,pdo_dblib,*}" ]; then
2023-04-09 10:55:06 +08:00
echo "---------- Install pdo_dblib ----------"
docker-php-ext-install pdo_dblib
2023-04-09 10:55:06 +08:00
fi
if [ -z "${EXTENSIONS##*,pdo_oci,*}" ]; then
2023-04-09 10:55:06 +08:00
echo "---------- Install pdo_oci ----------"
docker-php-ext-install pdo_oci
2023-04-09 10:55:06 +08:00
fi
if [ -z "${EXTENSIONS##*,pdo_odbc,*}" ]; then
2023-04-09 10:55:06 +08:00
echo "---------- Install pdo_odbc ----------"
docker-php-ext-install pdo_odbc
2023-04-09 10:55:06 +08:00
fi
if [ -z "${EXTENSIONS##*,pdo_pgsql,*}" ]; then
2023-04-09 10:55:06 +08:00
echo "---------- Install pdo_pgsql ----------"
docker-php-ext-install pdo_pgsql
2023-04-09 10:55:06 +08:00
fi
if [ -z "${EXTENSIONS##*,pgsql,*}" ]; then
2023-04-09 10:55:06 +08:00
echo "---------- Install pgsql ----------"
docker-php-ext-install pgsql
2023-04-09 10:55:06 +08:00
fi
if [ -z "${EXTENSIONS##*,oci8,*}" ]; then
2023-04-09 10:55:06 +08:00
echo "---------- Install oci8 ----------"
docker-php-ext-install oci8
2023-04-09 10:55:06 +08:00
fi
if [ -z "${EXTENSIONS##*,odbc,*}" ]; then
2023-04-09 10:55:06 +08:00
echo "---------- Install odbc ----------"
docker-php-ext-install odbc
2023-04-09 10:55:06 +08:00
fi
if [ -z "${EXTENSIONS##*,dba,*}" ]; then
2023-04-09 10:55:06 +08:00
echo "---------- Install dba ----------"
docker-php-ext-install dba
2023-04-09 10:55:06 +08:00
fi
if [ -z "${EXTENSIONS##*,interbase,*}" ]; then
2023-04-09 10:55:06 +08:00
echo "---------- Install interbase ----------"
docker-php-ext-install interbase
2023-04-09 10:55:06 +08:00
fi
if [ -z "${EXTENSIONS##*,soap,*}" ]; then
2023-04-09 10:55:06 +08:00
echo "---------- Install soap ----------"
apt-get install -y libxml2-dev
docker-php-ext-install soap
2023-04-09 10:55:06 +08:00
fi
if [ -z "${EXTENSIONS##*,xsl,*}" ]; then
2023-04-09 10:55:06 +08:00
echo "---------- Install xsl ----------"
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
if [ -z "${EXTENSIONS##*,xmlrpc,*}" ]; then
2023-04-09 10:55:06 +08:00
echo "---------- Install xmlrpc ----------"
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
if [ -z "${EXTENSIONS##*,wddx,*}" ]; then
2023-04-09 10:55:06 +08:00
echo "---------- Install wddx ----------"
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
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
if [ -z "${EXTENSIONS##*,readline,*}" ]; then
2023-04-09 10:55:06 +08:00
echo "---------- Install readline ----------"
apt-get install -y libreadline-dev
docker-php-ext-install readline
2023-04-09 10:55:06 +08:00
fi
if [ -z "${EXTENSIONS##*,snmp,*}" ]; then
2023-04-09 10:55:06 +08:00
echo "---------- Install snmp ----------"
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
if [ -z "${EXTENSIONS##*,pspell,*}" ]; then
2023-04-09 10:55:06 +08:00
echo "---------- Install pspell ----------"
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
if [ -z "${EXTENSIONS##*,recode,*}" ]; then
2023-04-09 10:55:06 +08:00
echo "---------- Install recode ----------"
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
if [ -z "${EXTENSIONS##*,tidy,*}" ]; then
2023-04-09 10:55:06 +08:00
echo "---------- Install tidy ----------"
apt-get install -y libtidy-dev
docker-php-ext-install tidy
2023-04-09 10:55:06 +08:00
fi
if [ -z "${EXTENSIONS##*,gmp,*}" ]; then
2023-04-09 10:55:06 +08:00
echo "---------- Install gmp ----------"
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
if [ -z "${EXTENSIONS##*,imap,*}" ]; then
2023-04-09 10:55:06 +08:00
echo "---------- Install imap ----------"
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
if [ -z "${EXTENSIONS##*,ldap,*}" ]; then
2023-04-09 10:55:06 +08:00
echo "---------- Install ldap ----------"
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
if [ -z "${EXTENSIONS##*,imagick,*}" ]; then
2023-04-09 10:55:06 +08:00
echo "---------- Install imagick ----------"
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
if [ -z "${EXTENSIONS##*,memcached,*}" ]; then
2023-04-09 10:55:06 +08:00
echo "---------- Install memcached ----------"
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
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
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
if [ -z "${EXTENSIONS##*,redis,*}" ]; then
echo "---------- Install redis ----------"
installExtensionFromTgz redis-4.1.1
2023-04-09 10:55:06 +08:00
fi