Determin PHP version if installed via debian packages system.

This commit is contained in:
2017-11-07 03:51:23 +01:00
parent 9176017e53
commit 24de2d80e1
2 changed files with 26 additions and 17 deletions

View File

@ -355,7 +355,7 @@ fi
# -
echononl "\tGet major version of all installed PHP versions"
if $PHP_DEBIAN_INSTALLATION ; then
echo_skipped
php_major_version="$(php --version | head -1 | cut -d' ' -f2 | cut -d '-' -f1 | cut -d'.' -f1,2)"
else
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
@ -548,10 +548,9 @@ if [[ -n "$php_major_versions" ]]; then
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
echononl " Start PHP FPM engine v${php_major_version}.."
if [[ -f "/etc/init.d/php$(echo $php_major_version | cut -d'.' -f1)-fpm" ]] ; then
/etc/init.d/php$(echo $php_major_version | cut -d'.' -f1)-fpm start > $log_file 2>&1
else
echo_skipped
fi