#!/bin/bash major_ver=7 minor_ver=1 patch_ver=33 php_version="${major_ver}${minor_ver}" php_version_dot="${major_ver}.${minor_ver}" php_version_slash="${major_ver}\.${minor_ver}" name='alt-php' version="${major_ver}.${minor_ver}.${patch_ver}" altdir="/opt/alt/php${php_version}" _prefix='/usr' _sysconfdir='/etc' _bindir="${_prefix}/bin" _sbindir="${_prefix}/sbin" echo "${name}-${version}" >> /opt/alt/alt_php.status [ -e /usr/bin/cl-linksafe-apply-group ] && /usr/bin/cl-linksafe-apply-group ${name}${php_version} || : if [ -x /opt/alt/alt-php-config/multiphp_reconfigure.py ]; then /opt/alt/alt-php-config/multiphp_reconfigure.py --php ${php_version} fi # Enable nd_mysqli driver instead mysqli if [ -x /usr/sbin/cloudlinux-selector ]; then if [ $(/usr/sbin/cloudlinux-selector --help | grep 'make-defaults-config' > /dev/null) ]; then /usr/sbin/cloudlinux-selector make-defaults-config --json --interpreter=php fi fi if [ -x /opt/alt/alt-php-config/alt-php-panel-configuration.py ]; then /opt/alt/alt-php-config/alt-php-panel-configuration.py --mode=install --php=${php_version} fi if [ -z "${__imunify}" ]; then CONF_DIR='/etc/cl.selector' CONF_PATH="$CONF_DIR/selector.conf" BIN_DIR=${altdir}${_bindir} SBIN_DIR=${altdir}${_sbindir} VERS=${php_version_dot} VERS2=${php_version_slash} mkdir -p $CONF_DIR touch $CONF_PATH VERSION="$(echo ${version} | awk -F '(alpha|beta|RC[0-9]+)' '{print $1}')" sed -i -e "/\s$VERS2/d" $CONF_PATH cat >> $CONF_PATH <