Use local php. Part 3

This commit is contained in:
Alexey Berezhok
2025-01-18 15:55:12 +03:00
parent 2f91eee76d
commit f3b9d33016
10 changed files with 161 additions and 139 deletions

View File

@@ -67,21 +67,29 @@ csv_list() {
declare -a versions
# List through /etc/php
if [ -f /etc/redhat-release ]; then
for version in /etc/opt/remi/php*/; do
ver=$(echo "$version" | awk -F"/" '{ print $5 }' | sed 's|php||')
versions+=("$ver")
done
else
if [ -n "$WEB_BACKEND" ]; then
for version in /etc/php/*/fpm; do
ver=$(echo "$version" | awk -F"/" '{ print $4 }')
if [ "$LOCAL_PHP" == "yes" ]; then
if [ -n "$WEB_BACKEND" ]; then
for version in /opt/brepo/php*/; do
ver=$(echo "$version" | awk -F"/" '{ print $4 }' | sed 's|php||')
versions+=("$ver")
done
else
# Fix for modphp
for version in /etc/php/*/cli; do
ver=$(echo "$version" | awk -F"/" '{ print $4 }')
for version in /opt/brepo/php*/bin/php; do
ver=$(echo "$version" | awk -F"/" '{ print $4 }' | sed 's|php||')
versions+=("$ver")
done
fi
else
if [ -n "$WEB_BACKEND" ]; then
for version in /etc/opt/remi/php*/; do
ver=$(echo "$version" | awk -F"/" '{ print $5 }' | sed 's|php||')
versions+=("$ver")
done
else
# Fix for modphp
for version in /opt/remi/php*/root/bin/php; do
ver=$(echo "$version" | awk -F"/" '{ print $4 }' | sed 's|php||')
versions+=("$ver")
done
fi