#!/bin/bash major_ver=8 minor_ver=0 patch_ver=30 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" __imunify= if [ -n "${__imunify}" ]; then altdir="/opt/alt/php-internal" fi if [ -n "${__imunify}" ]; then find ${altdir} -type f -exec chmod 700 {} \; chmod 700 ${altdir}${_sysconfdir}/php.d chmod 700 ${altdir}/link chmod 5700 ${altdir}/var/lib/php/session chmod 600 ${altdir}${_sysconfdir}/php.d/default.ini chmod 700 ${altdir}${_libdir}/php chmod 700 ${altdir}${_libdir}/php/modules chmod 700 ${altdir}${_includedir}/php chmod 700 ${altdir}${_includedir}/php/ext else [ -x /usr/bin/cl-linksafe-apply-group ] && /usr/bin/cl-linksafe-apply-group ${name}${php_version} || : chmod 5733 ${altdir}/var/lib/php/session fi if [ -z "${__imunify}" ]; then echo "${name}-${version}" >> /opt/alt/alt_php.status 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 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 <