Use local php. Part 3
This commit is contained in:
21
func/main.sh
21
func/main.sh
@@ -1561,9 +1561,16 @@ multiphp_count() {
|
||||
multiphp_versions() {
|
||||
local -a php_versions_list
|
||||
local php_ver
|
||||
local php_type_internal=$(cat "$HESTIA/conf/hestia.conf" | grep "LOCAL_PHP" | grep "yes")
|
||||
local pool_internal=""
|
||||
if [ "$(multiphp_count)" -gt 0 ]; then
|
||||
for php_ver in $($BIN/v-list-sys-php plain); do
|
||||
[ ! -d "/etc/php/$php_ver/fpm/pool.d/" ] && continue
|
||||
if [ -n "$php_type_internal" ]; then
|
||||
pool_internal="/opt/brepo/php$php_ver/etc/php-fpm.d"
|
||||
else
|
||||
pool_internal="/etc/opt/remi/php$php_ver/php-fpm.d"
|
||||
fi
|
||||
[ ! -d "$pool_internal" ] && continue
|
||||
php_versions_list+=($php_ver)
|
||||
done
|
||||
echo "${php_versions_list[@]}"
|
||||
@@ -1572,11 +1579,19 @@ multiphp_versions() {
|
||||
|
||||
multiphp_default_version() {
|
||||
# Get system wide default php version (set by update-alternatives)
|
||||
local sys_phpversion=$(php -r "echo substr(phpversion(),0,3);")
|
||||
local sys_phpversion_l=$(php -r "echo substr(phpversion(),0,3);")
|
||||
local sys_phpversion="${sys_phpversion_l//./}"
|
||||
local php_type_internal=$(cat "$HESTIA/conf/hestia.conf" | grep "LOCAL_PHP" | grep "yes")
|
||||
local pool_internal=""
|
||||
if [ -n "$php_type_internal" ]; then
|
||||
pool_internal="/opt/brepo/php$sys_phpversion/etc/php-fpm.d"
|
||||
else
|
||||
pool_internal="/etc/opt/remi/php$sys_phpversion/php-fpm.d"
|
||||
fi
|
||||
|
||||
# Check if the system php also has php-fpm enabled, otherwise return
|
||||
# the most recent php version which does have it installed.
|
||||
if [ ! -d "/etc/php/$sys_phpversion/fpm/pool.d/" ]; then
|
||||
if [ ! -d "$pool_internal" ]; then
|
||||
local all_versions="$(multiphp_versions)"
|
||||
if [ -n "$all_versions" ]; then
|
||||
sys_phpversion="${all_versions##*\ }"
|
||||
|
||||
Reference in New Issue
Block a user