mod_php_install.sh: add support for php 5.6 at debian 10 (buster).

This commit is contained in:
Christoph 2019-10-13 01:01:53 +02:00
parent 166031f410
commit c49065a61b
2 changed files with 627 additions and 58 deletions

View File

@ -1,8 +1,7 @@
## - Install redis extension under php 5.6
## -
## - Note: the actual version (at time 3.0) requires php vsersion >= 7.0
## - (and for now < 7.1)
## - Note: the actual version (at time 5.0.2) requires php vsersion >= 7.0
## -
## - Note: On php 5.6.x install redis v. 2.2.8
## - Note: On php 5.6.x install redis v. 4.2.0
## -
pecl install redis-2.2.8
pecl install redis-4.2.0

View File

@ -5,6 +5,8 @@
_VERSION=
_FREETYPE_VERSION="2.9.1"
_ICU4C_VERSION="57-2"
_LIBXML2_VERSION="2.9.4"
#WITHOUT_APACHE_MOD_PHP=true
_APACHE_MOD_PHP=no
@ -35,6 +37,8 @@ _CRONTAB_BAKUP_FILE="$(mktemp)"
_VSERVER_GUEST=no
_backup_date="$(date +%Y%m%d-%H%M)"
## --- Some functions
## ---
@ -327,6 +331,16 @@ else
unset MAKEFLAGS
fi
if [[ "$PHP_MAIN_VERSION" = "5.6" ]] && [[ $os_version -gt 9 ]]; then
#if [[ -e "/usr/local/libxml2" ]]; then
warn "For php version 5.6 at debian 10 and above, you need manual installation of
\t freetype (libfreetype6-dev)
\t libxml2
\t icu4c (libicu)"
#fi
fi
echo ""
echo ""
echo -e "\033[32m--\033[m"
@ -837,6 +851,8 @@ fi
_install_freetype=false
_install_icu4c=false
_install_libxml2=false
if ([[ "$PHP_MAJOR_VERSION" -eq 7 ]] && [[ "$PHP_MINOR_VERSION" -lt 4 ]]) \
|| [[ "$PHP_MAJOR_VERSION" -lt 7 ]] ; then
@ -851,7 +867,6 @@ if ([[ "$PHP_MAJOR_VERSION" -eq 7 ]] && [[ "$PHP_MINOR_VERSION" -lt 4 ]]) \
echo -e ""
echo -e "Which version of freetype should be installed?"
echo ""
echo ""
FREETYPE_VERSION=
if [[ -n "$_FREETYPE_VERSION" ]]; then
echononl "Freetype Version [${_FREETYPE_VERSION}]: "
@ -870,7 +885,73 @@ if ([[ "$PHP_MAJOR_VERSION" -eq 7 ]] && [[ "$PHP_MINOR_VERSION" -lt 4 ]]) \
fi
_install_freetype=true
fi
if [[ "$PHP_MAJOR_VERSION" -lt 7 ]] ; then
echo ""
echo ""
echo -e "\033[32m--\033[m"
echo ""
echo -e "We need to install a version of libicu (icu4c), which supports"
echo -e "service 'icu-config'. The development library libicu-dev"
echo -e "of this distribution doesn't."
echo -e ""
echo -e "Which version of icu4c should be installed?"
echo ""
ICU4C_VERSION=
if [[ -n "$_ICU4C_VERSION" ]]; then
echononl "ICU4C Version [${_ICU4C_VERSION}]: "
read ICU4C_VERSION
if [[ "X$ICU4C_VERSION" = "X" ]] ; then
ICU4C_VERSION="$_ICU4C_VERSION"
fi
else
echononl "ICU4C Version: "
read ICU4C_VERSION
while [[ "X$ICU4C_VERSION" = "X" ]]; do
echo -e "\n \033[33m\033[1ICU4C Version must not be empty!\033[m\n"
echononl "ICU4C Version : "
read ICU4C_VERSION
done
fi
ICU4C_MAJOR_VERSION=`echo $ICU4C_VERSION | cut -d '-' -f1`
ICU4C_MINOR_VERSION=`echo $ICU4C_VERSION | cut -d '-' -f2`
_install_icu4c=true
echo ""
echo ""
echo -e "\033[32m--\033[m"
echo ""
echo "We need to install an manual installed version of libxml2 (without icu support),"
echo "because the installed one has icu support, but is linked against the distribution"
echo "supported libicu-dev package."
echo -e ""
echo -e "Which version of freetype should be installed?"
echo ""
LIBXML2_VERSION=
if [[ -n "$_LIBXML2_VERSION" ]]; then
echononl "LIBXML2 Version [${_LIBXML2_VERSION}]: "
read LIBXML2_VERSION
if [[ "X$LIBXML2_VERSION" = "X" ]] ; then
LIBXML2_VERSION="$_LIBXML2_VERSION"
fi
else
echononl "LIBXML2 Version: "
read LIBXML2_VERSION
while [[ "X$LIBXML2_VERSION" = "X" ]]; do
echo -e "\n \033[33m\033[1LIBXML2 Version must not be empty!\033[m\n"
echononl "LIBXML2 Version : "
read LIBXML2_VERSION
done
fi
_install_libxml2=true
fi # if [[ "$PHP_MAJOR_VERSION" -lt 7 ]]
fi # if [[ "$os_dist" = "debian" ]] && [[ $os_version -eq 10 ]]
fi
@ -933,31 +1014,6 @@ if [ "$VSERVER_GUEST" = "yes" ]; then
fi
declare -a existing_fpm_definition_arr=()
FPM_DEFAULT_POOL_DEFINITION_EXISTS=false
if $WITH_PHP_FPM_SUPPORT ; then
echo ""
echo -e "\033[32m--\033[m"
echononl "Get existing socket definitions"
if [[ -n "$(ls /usr/local/php-${PHP_MAIN_VERSION}/etc/fpm.d/*.conf 2>/dev/null)" ]]; then
for _file in $(ls /usr/local/php-${PHP_MAIN_VERSION}/etc/fpm.d/*.conf) ; do
if [[ "$(basename "$_file")" = "${FPM_DEFAULT_POOL}.php-fpm.conf" ]]; then
FPM_DEFAULT_POOL_DEFINITION_EXISTS=true
fi
existing_fpm_definition_arr+=("$(realpath "$_file")")
done
echo_ok
else
echo_skipped
fi
echo -e "\033[32m--\033[m"
echo ""
fi
echo ""
echo ""
@ -1028,6 +1084,16 @@ if $_install_freetype ; then
echo " freetype version .............: $_FREETYPE_VERSION"
fi
echo ""
echo "Install extern libicu ...........: $_install_icu4c"
if $_install_icu4c ; then
echo " icu4c version ................: $_ICU4C_VERSION"
fi
echo ""
echo "Install extern libxml2 ..........: $_install_libxml2"
if $_install_libxml2 ; then
echo " libxml2 version ..............: $_LIBXML2_VERSION"
fi
echo ""
echo "Skip 'updatedb'..................: $SKIP_UPDATE_DB"
echo ""
echo ""
@ -1050,14 +1116,52 @@ echo ""
## --------------------------------------------------
if [ -d "$_logdir" ];then
mv $_logdir $_logdir.`date +%Y%m%d-%H%M`
mv $_logdir $_logdir.$_backup_date
fi
mkdir -p $_logdir > /dev/null 2>&1
if [ -d "$_builddir" ];then
mv $_builddir $_builddir.`date +%Y%m%d-%H%M`
mv $_builddir $_builddir.$_backup_date
fi
if [ -d "$PREFIX_PHP" ];then
mv $PREFIX_PHP $PREFIX_PHP.`date +%Y%m%d-%H%M`
mv $PREFIX_PHP $PREFIX_PHP.$_backup_date
fi
declare -a existing_fpm_definition_arr=()
FPM_DEFAULT_POOL_DEFINITION_EXISTS=false
if $WITH_PHP_FPM_SUPPORT ; then
echo ""
echo -e "\033[32m--\033[m"
echononl "Get existing socket definitions"
if [[ -n "$(ls $PREFIX_PHP.${_backup_date}/etc/fpm.d/*.conf 2>/dev/null)" ]]; then
for _file in $(ls $PREFIX_PHP.${_backup_date}/etc/fpm.d/*.conf) ; do
if [[ "$(basename "$_file")" = "${FPM_DEFAULT_POOL}.php-fpm.conf" ]]; then
FPM_DEFAULT_POOL_DEFINITION_EXISTS=true
fi
existing_fpm_definition_arr+=("$(realpath "$_file")")
done
echo_ok
elif [[ -n "$(ls /usr/local/php-${PHP_MAIN_VERSION}/etc/fpm.d/*.conf 2>/dev/null)" ]]; then
for _file in $(ls /usr/local/php-${PHP_MAIN_VERSION}/etc/fpm.d/*.conf) ; do
if [[ "$(basename "$_file")" = "${FPM_DEFAULT_POOL}.php-fpm.conf" ]]; then
FPM_DEFAULT_POOL_DEFINITION_EXISTS=true
fi
existing_fpm_definition_arr+=("$(realpath "$_file")")
done
echo_ok
else
echo_skipped
fi
echo -e "\033[32m--\033[m"
echo ""
fi
@ -1197,7 +1301,7 @@ if $_install_freetype && [[ ! -d /usr/local/freetype-$FREETYPE_VERSION ]]; then
_backup_dir="$_build_dir_freetype"
echononl "\tBackup existing directory '${_backup_dir}'.."
if [[ -d "${_backup_dir}" ]]; then
mv "${_backup_dir}" "${_backup_dir}.$(date +%Y%m%d-%H%M)" > /dev/null 2> $tmp_err_msg
mv "${_backup_dir}" "${_backup_dir}.$_backup_date" > /dev/null 2> $tmp_err_msg
if [[ $? -eq 0 ]] ; then
echo_ok
else
@ -1277,7 +1381,7 @@ if $_install_freetype && [[ ! -d /usr/local/freetype-$FREETYPE_VERSION ]]; then
_backup_dir="/usr/local/freetype-${FREETYPE_VERSION}"
echononl "\tBackup existing directory '${_backup_dir}'.."
if [[ -d "${_backup_dir}" ]]; then
mv "${_backup_dir}" "${_backup_dir}.$(date +%Y%m%d-%H%M)" > /dev/null 2> $tmp_err_msg
mv "${_backup_dir}" "${_backup_dir}.$_backup_date" > /dev/null 2> $tmp_err_msg
if [[ $? -eq 0 ]] ; then
echo_ok
else
@ -1339,6 +1443,428 @@ if $_install_freetype && [[ ! -d /usr/local/freetype-$FREETYPE_VERSION ]]; then
fi
if $_install_icu4c && [[ ! -d /usr/local/icu4c-$ICU4C_VERSION ]]; then
## - Install icu4c (with support for 'icu-config'
## -
echo ""
echo ""
echo -e "\t---"
echo -e "\t--- Install icu4c with support for 'icu-config'"
echo -e "\t---"
echo ""
icu4c_archive="icu4c-${ICU4C_MAJOR_VERSION}_${ICU4C_MINOR_VERSION}-src.tgz"
_src_dir_icu4c="/usr/local/src/icu4c"
_build_dir_icu4c="${_src_dir_icu4c}/icu/source"
echononl "\tCreate source directory '$_src_dir_icu4c'.."
if [[ ! -d "$_src_dir_icu4c" ]]; then
mkdir "$_src_dir_icu4c" >> ${_logdir}/main.log 2>&1
if [[ $? -eq 0 ]]; then
echo_ok
else
echo_failed
error "Cannot create directory '$_src_dir_icu4c'"
echononl "continue anyway [yes/no]: "
read OK
OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')"
while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do
echononl "Wrong entry! - repeat [yes/no]: "
read OK
done
[[ $OK = "yes" ]] || fatal "Interupted by user"
fi
else
echo_skipped
fi
cd "$_src_dir_icu4c"
echononl "\tGet source $icu4c_archive .."
if [[ ! -f ${_src_dir_icu4c}/$icu4c_archive ]]; then
wget -O "${_src_dir_icu4c}/$icu4c_archive" \
https://github.com/unicode-org/icu/releases/download/release-${ICU4C_VERSION}/$icu4c_archive \
>> ${_logdir}/main.log 2>&1
if [ "$?" = "0" ]; then
echo_ok
else
echo_failed
error "Cannot Download '$icu4c_archive'"
echononl "continue anyway [yes/no]: "
read OK
OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')"
while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do
echononl "Wrong entry! - repeat [yes/no]: "
read OK
done
[[ $OK = "yes" ]] || fatal "Interupted by user"
fi
else
echo_skipped
fi
_backup_dir="${_src_dir_icu4c}/icu"
echononl "\tBackup existing directory '${_backup_dir}'.."
if [[ -d "${_backup_dir}" ]]; then
mv "${_backup_dir}" "${_backup_dir}.$_backup_date" > /dev/null 2> $tmp_err_msg
if [[ $? -eq 0 ]] ; then
echo_ok
else
echo_failed
error "$(cat $tmp_err_msg)"
echononl "continue anyway [yes/no]: "
read OK
OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')"
while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do
echononl "Wrong entry! - repeat [yes/no]: "
read OK
done
[[ $OK = "yes" ]] || fatal "Interupted by user"
fi
else
echo_skipped
fi
echononl "\tUnpack archive \"$icu4c_archive\".."
gunzip < "${icu4c_archive}" | tar -xf - 2> $tmp_err_msg
if [[ $? -eq 0 ]]; then
echo_ok
else
echo_failed
error "$(cat $tmp_err_msg)"
echononl "continue anyway [yes/no]: "
read OK
OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')"
while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do
echononl "Wrong entry! - repeat [yes/no]: "
read OK
done
[[ $OK = "yes" ]] || fatal "Interupted by user"
fi
cd "$_build_dir_icu4c"
config_params="--prefix=/usr/local/icu4c-$ICU4C_VERSION"
echononl "\tGoing to configure icu4c-$ICU4C_VERSION .."
./configure $config_params >> ${_logdir}/icu4c-configure.log 2>&1
if [ "$?" = "0" ]; then
echo_ok
else
echo_failed
error "Configuring icu4c failed!\n\t see ${_logdir}/icu4c-configure.log for more details"
echononl "continue anyway [yes/no]: "
read OK
OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')"
while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do
echononl "Wrong entry! - repeat [yes/no]: "
read OK
done
[[ $OK = "yes" ]] || fatal "Interupted by user"
fi
echononl "\tGoing to compile icu4c-$ICU4C_VERSION .."
make > ${_logdir}/icu4c-make.log 2>&1
if [ "$?" = "0" ]; then
echo_ok
else
echo_failed
error "Compiling icu4c failed!\n\t see ${_logdir}/icu4c-make.log for more details"
echononl "continue anyway [yes/no]: "
read OK
OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')"
while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do
echononl "Wrong entry! - repeat [yes/no]: "
read OK
done
[[ $OK = "yes" ]] || fatal "Interupted by user"
fi
_backup_dir="/usr/local/icu4c-${ICU4C_VERSION}"
echononl "\tBackup existing directory '${_backup_dir}'.."
if [[ -d "${_backup_dir}" ]]; then
mv "${_backup_dir}" "${_backup_dir}.$_backup_date" > /dev/null 2> $tmp_err_msg
if [[ $? -eq 0 ]] ; then
echo_ok
else
echo_failed
error "$(cat $tmp_err_msg)"
echononl "continue anyway [yes/no]: "
read OK
OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')"
while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do
echononl "Wrong entry! - repeat [yes/no]: "
read OK
done
[[ $OK = "yes" ]] || fatal "Interupted by user"
fi
else
echo_skipped
fi
echononl "\tGoing to install icu4c-$ICU4C_VERSION.."
make install > ${_logdir}/icu4c-make_install.log 2>&1
if [[ $? -eq 0 ]]; then
echo_ok
else
echo_failed
error "Installing icu4c failed!\n\t see ${_logdir}/icu4c-make_install.log for more details"
echononl "continue anyway [yes/no]: "
read OK
OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')"
while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do
echononl "Wrong entry! - repeat [yes/no]: "
read OK
done
[[ $OK = "yes" ]] || fatal "Interupted by user"
fi
echononl "\tSet symlink /usr/local/icu4c -> /usr/local/icu4c-$ICU4C_VERSION .."
if [ -L /usr/local/icu4c ];then
rm -f /usr/local/icu4c
fi
ln -s icu4c-$ICU4C_VERSION /usr/local/icu4c > $tmp_err_msg 2>&1
if [[ $? -eq 0 ]]; then
echo_ok
else
echo_failed
error "$(cat $tmp_err_msg)"
echononl "continue anyway [yes/no]: "
read OK
OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')"
while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do
echononl "Wrong entry! - repeat [yes/no]: "
read OK
done
[[ $OK = "yes" ]] || fatal "Interupted by user"
fi
fi
if $_install_libxml2 && [[ ! -d /usr/local/libxml2-$LIBXML2_VERSION ]]; then
## - Install libxml2'
## -
echo ""
echo ""
echo -e "\t---"
echo -e "\t--- Install libxml2"
echo -e "\t---"
echo ""
libxml2_archive="libxml2-${LIBXML2_VERSION}.tar.gz"
_src_dir_libxml2="/usr/local/src/libxml2"
_build_dir_libxml2="${_src_dir_libxml2}/libxml2-${LIBXML2_VERSION}"
echononl "\tCreate source directory '$_src_dir_libxml2'.."
if [[ ! -d "$_src_dir_libxml2" ]]; then
mkdir "$_src_dir_libxml2" >> ${_logdir}/main.log 2>&1
if [[ $? -eq 0 ]]; then
echo_ok
else
echo_failed
error "Cannot create directory '$_src_dir_libxml2'"
echononl "continue anyway [yes/no]: "
read OK
OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')"
while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do
echononl "Wrong entry! - repeat [yes/no]: "
read OK
done
[[ $OK = "yes" ]] || fatal "Interupted by user"
fi
else
echo_skipped
fi
cd "$_src_dir_libxml2"
echononl "\tGet source $libxml2_archive .."
if [[ ! -f ${_src_dir_libxml2}/$libxml2_archive ]]; then
wget -O "${_src_dir_libxml2}/$libxml2_archive" \
ftp://xmlsoft.org/libxml2/${libxml2_archive} \
>> ${_logdir}/main.log 2>&1
if [ "$?" = "0" ]; then
echo_ok
else
echo_failed
error "Cannot Download '$libxml2_archive'"
echononl "continue anyway [yes/no]: "
read OK
OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')"
while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do
echononl "Wrong entry! - repeat [yes/no]: "
read OK
done
[[ $OK = "yes" ]] || fatal "Interupted by user"
fi
else
echo_skipped
fi
_backup_dir="$_build_dir_libxml2"
echononl "\tBackup existing directory '${_backup_dir}'.."
if [[ -d "${_backup_dir}" ]]; then
mv "${_backup_dir}" "${_backup_dir}.$_backup_date" > /dev/null 2> $tmp_err_msg
if [[ $? -eq 0 ]] ; then
echo_ok
else
echo_failed
error "$(cat $tmp_err_msg)"
echononl "continue anyway [yes/no]: "
read OK
OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')"
while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do
echononl "Wrong entry! - repeat [yes/no]: "
read OK
done
[[ $OK = "yes" ]] || fatal "Interupted by user"
fi
else
echo_skipped
fi
echononl "\tUnpack archive \"$libxml2_archive\".."
gunzip < "${libxml2_archive}" | tar -xf - 2> $tmp_err_msg
if [[ $? -eq 0 ]]; then
echo_ok
else
echo_failed
error "$(cat $tmp_err_msg)"
echononl "continue anyway [yes/no]: "
read OK
OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')"
while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do
echononl "Wrong entry! - repeat [yes/no]: "
read OK
done
[[ $OK = "yes" ]] || fatal "Interupted by user"
fi
cd "$_build_dir_libxml2"
config_params="--prefix=/usr/local/libxml2-$LIBXML2_VERSION"
echononl "\tGoing to configure libxml2-$LIBXML2_VERSION .."
./configure $config_params >> ${_logdir}/libxml2-configure.log 2>&1
if [ "$?" = "0" ]; then
echo_ok
else
echo_failed
error "Configuring libxml2 failed!\n\t see ${_logdir}/libxml2-configure.log-configure.log for more details"
echononl "continue anyway [yes/no]: "
read OK
OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')"
while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do
echononl "Wrong entry! - repeat [yes/no]: "
read OK
done
[[ $OK = "yes" ]] || fatal "Interupted by user"
fi
echononl "\tGoing to compile libxml2-$LIBXML2_VERSION .."
make > ${_logdir}/libxml2-make.log 2>&1
if [ "$?" = "0" ]; then
echo_ok
else
echo_failed
error "Compiling libxml2 failed!\n\t see ${_logdir}/libxml2-make.log for more details"
echononl "continue anyway [yes/no]: "
read OK
OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')"
while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do
echononl "Wrong entry! - repeat [yes/no]: "
read OK
done
[[ $OK = "yes" ]] || fatal "Interupted by user"
fi
_backup_dir="/usr/local/libxml2-${LIBXML2_VERSION}"
echononl "\tBackup existing directory '${_backup_dir}'.."
if [[ -d "${_backup_dir}" ]]; then
mv "${_backup_dir}" "${_backup_dir}.$_backup_date" > /dev/null 2> $tmp_err_msg
if [[ $? -eq 0 ]] ; then
echo_ok
else
echo_failed
error "$(cat $tmp_err_msg)"
echononl "continue anyway [yes/no]: "
read OK
OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')"
while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do
echononl "Wrong entry! - repeat [yes/no]: "
read OK
done
[[ $OK = "yes" ]] || fatal "Interupted by user"
fi
else
echo_skipped
fi
echononl "\tGoing to install libxml2-$LIBXML2_VERSION.."
make install > ${_logdir}/libxml2-make_install.log 2>&1
if [[ $? -eq 0 ]]; then
echo_ok
else
echo_failed
error "Installing libxml2 failed!\n\t see ${_logdir}/libxml2-make_install.log for more details"
echononl "continue anyway [yes/no]: "
read OK
OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')"
while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do
echononl "Wrong entry! - repeat [yes/no]: "
read OK
done
[[ $OK = "yes" ]] || fatal "Interupted by user"
fi
echononl "\tSet symlink /usr/local/libxml2 -> /usr/local/libxml2-$LIBXML2_VERSION .."
if [ -L /usr/local/libxml2 ];then
rm -f /usr/local/libxml2
fi
ln -s libxml2-$LIBXML2_VERSION /usr/local/libxml2 > $tmp_err_msg 2>&1
if [[ $? -eq 0 ]]; then
echo_ok
else
echo_failed
error "$(cat $tmp_err_msg)"
echononl "continue anyway [yes/no]: "
read OK
OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')"
while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do
echononl "Wrong entry! - repeat [yes/no]: "
read OK
done
[[ $OK = "yes" ]] || fatal "Interupted by user"
fi
fi
## - Set Symlink
## - /usr/include/x86_64-linux-gnu/gmp.h -> /usr/include/gmp.h
## - if not exists
@ -1579,6 +2105,11 @@ else
fi
fi
if [[ "$PHP_MAJOR_VERSION" -eq "5" ]] && [[ "$os_dist" = "debian" ]] && [[ $os_version -ge 10 ]]; then
config_params="$config_params \
--with-icu-dir=/usr/local/icu4c \
--with-libxml-dir=/usr/local/libxml2"
fi
# --with-fpm-systemd \
@ -1713,7 +2244,7 @@ fi
#cp php.ini-production $PHP_INI_FILE || exit 1
[ -f $PHP_INI_FILE ] && cp -a $PHP_INI_FILE ${$PHP_INI_FILE}-`date +"%Y-%m-%d-%H%M"`
[ -f $PHP_INI_FILE ] && cp -a $PHP_INI_FILE ${$PHP_INI_FILE}-$_backup_date
cp php.ini-production $PHP_INI_FILE || exit 1
## - Temporarily change PATH environment variable
@ -2604,21 +3135,40 @@ fi
## -----
echononl "\tInstall solr via pecl.."
printf "\n" | ${PREFIX_PHP}/bin/pecl install solr > /dev/null 2>&1
if [ "$?" = "0" ]; then
echo_ok
echononl "\tphp.ini: extension=solr .."
_extension="solr.so"
perl -i -n -p -e "s#^(\s*\[PHP\]\s*)#\1\nextension=${_extension}\n#" $PHP_INI_FILE
if [[ $PHP_MAJOR_VERSION -lt 7 ]] ; then
printf "\n" | ${PREFIX_PHP}/bin/pecl install solr-2.4.0 > /dev/null 2>&1
if [ "$?" = "0" ]; then
echo_ok
echononl "\tphp.ini: extension=solr .."
_extension="solr.so"
perl -i -n -p -e "s#^(\s*\[PHP\]\s*)#\1\nextension=${_extension}\n#" $PHP_INI_FILE
if [ "$?" = "0" ]; then
echo_ok
else
echo_failed
fi
else
echo_failed
fi
else
echo_failed
printf "\n" | ${PREFIX_PHP}/bin/pecl install solr > /dev/null 2>&1
if [ "$?" = "0" ]; then
echo_ok
echononl "\tphp.ini: extension=solr .."
_extension="solr.so"
perl -i -n -p -e "s#^(\s*\[PHP\]\s*)#\1\nextension=${_extension}\n#" $PHP_INI_FILE
if [ "$?" = "0" ]; then
echo_ok
else
echo_failed
fi
else
echo_failed
fi
fi
## -----
@ -2631,21 +3181,40 @@ fi
## -----
echononl "\tInstall redis via pecl.."
printf "\n" | ${PREFIX_PHP}/bin/pecl install redis > /dev/null 2>&1
if [ "$?" = "0" ]; then
echo_ok
echononl "\tphp.ini: extension=redis .."
_extension="redis.so"
perl -i -n -p -e "s#^(\s*\[PHP\]\s*)#\1\nextension=${_extension}\n#" $PHP_INI_FILE
if [[ $PHP_MAJOR_VERSION -lt 7 ]] ; then
printf "\n" | ${PREFIX_PHP}/bin/pecl install redis-4.2.0 > /dev/null 2>&1
if [ "$?" = "0" ]; then
echo_ok
echononl "\tphp.ini: extension=redis .."
_extension="redis.so"
perl -i -n -p -e "s#^(\s*\[PHP\]\s*)#\1\nextension=${_extension}\n#" $PHP_INI_FILE
if [ "$?" = "0" ]; then
echo_ok
else
echo_failed
fi
else
echo_failed
fi
else
echo_failed
printf "\n" | ${PREFIX_PHP}/bin/pecl install redis > /dev/null 2>&1
if [ "$?" = "0" ]; then
echo_ok
echononl "\tphp.ini: extension=redis .."
_extension="redis.so"
perl -i -n -p -e "s#^(\s*\[PHP\]\s*)#\1\nextension=${_extension}\n#" $PHP_INI_FILE
if [ "$?" = "0" ]; then
echo_ok
else
echo_failed
fi
else
echo_failed
fi
fi
## -----
@ -2678,8 +3247,9 @@ else
warn "Pecl extension 'uri_template' is only available for PHP versions < 7 - version 7 also excluded."
fi
## -----
## - END: Install uri_template
## -----
## -----
## - Install APCu
@ -3157,7 +3727,7 @@ if $LEGACY_SQL_FUNCTION_SUPPORT ; then
echononl "\tBackup existing directory '${_lsf_src_dir}'.."
if [[ -d "${_lsf_src_dir}" ]]; then
mv "$_lsf_src_dir" "${_lsf_src_dir}.$(date +%Y%m%d-%H%M)" > /dev/null 2> $tmp_err_msg
mv "$_lsf_src_dir" "${_lsf_src_dir}.$_backup_date" > /dev/null 2> $tmp_err_msg
if [[ $? -eq 0 ]] ; then
echo_ok
else