Support PHP installed from Debian Packages System.

This commit is contained in:
2017-11-06 04:24:52 +01:00
parent 7427ebec6b
commit 186d3b94d5
3 changed files with 136 additions and 31 deletions

View File

@ -354,19 +354,23 @@ fi
# - Determin PHP of all installed versions
# -
echononl "\tGet major version of all installed PHP versions"
php_major_versions="$(find /usr/local/ -maxdepth 1 -mindepth 1 -type l -name "php-*" -print | cut -d "-" -f2 | sort)"
if [[ -z "$php_major_versions" ]]; then
echo_failed
error "Getting version numbers of installed PHP versions failed! No installed PHP versiond found!"
if $PHP_DEBIAN_INSTALLATION ; then
echo_skipped
else
echo_ok
php_major_versions="$(find /usr/local/ -maxdepth 1 -mindepth 1 -type l -name "php-*" -print | cut -d "-" -f2 | sort)"
if [[ -z "$php_major_versions" ]]; then
echo_failed
error "Getting version numbers of installed PHP versions failed! No installed PHP versiond found!"
else
echo_ok
fi
fi
# - Stop all PHP FPM engines
# -
echononl " Stop PHP FPM engine v${_ver}.."
if [[ -n "$php_major_versions" ]]; then
for _ver in $php_major_versions ; do
echononl " Stop PHP FPM engine v${_ver}.."
if [[ -f "/etc/init.d/php-${_ver}-fpm" ]]; then
/etc/init.d/php-${_ver}-fpm stop > $log_file 2>&1
if [[ $? -eq 0 ]]; then
@ -387,6 +391,24 @@ if [[ -n "$php_major_versions" ]]; then
echo_skipped
fi
done
else
if $PHP_DEBIAN_INSTALLATION ; then
if [[ -f "/etc/init.d/php5-fpm" ]] ; then
/etc/init.d/php5-fpm stop > $log_file 2>&1
elif [[ -f "/etc/init.d/php7-fpm" ]] ; then
/etc/init.d/php7-fpm stop > $log_file 2>&1
else
echo_skipped
fi
if [[ $? -eq 0 ]]; then
echo_ok
else
echo_failed
error "$(cat $log_file)"
fi
else
echo_skipped
fi
fi
echo -e "\n\n \033[37m\033[1mUgrade Roundcube Webmail..\033[m\n"
@ -524,6 +546,24 @@ if [[ -n "$php_major_versions" ]]; then
echo_skipped
fi
done
else
if $PHP_DEBIAN_INSTALLATION ; then
if [[ -f "/etc/init.d/php5-fpm" ]] ; then
/etc/init.d/php5-fpm start > $log_file 2>&1
elif [[ -f "/etc/init.d/php7-fpm" ]] ; then
/etc/init.d/php7-fpm start > $log_file 2>&1
else
echo_skipped
fi
if [[ $? -eq 0 ]]; then
echo_ok
else
echo_failed
error "$(cat $log_file)"
fi
else
echo_skipped
fi
fi
# - Start Apache Webserver