mirror of
https://github.com/pi-hole/pi-hole.git
synced 2024-11-15 02:42:58 +00:00
don't use major.minor for PHP 5
Signed-off-by: <rrobgill@protonmail.com>
This commit is contained in:
parent
a3569d88c9
commit
6381bdbf33
1 changed files with 5 additions and 5 deletions
|
@ -166,13 +166,13 @@ if command -v apt-get &> /dev/null; then
|
||||||
echo -e " ${INFO} Existing PHP installation detected : PHP version $phpInsVersion"
|
echo -e " ${INFO} Existing PHP installation detected : PHP version $phpInsVersion"
|
||||||
phpInsMajor="$(echo "$phpInsVersion" | cut -d\. -f1)"
|
phpInsMajor="$(echo "$phpInsVersion" | cut -d\. -f1)"
|
||||||
phpInsMinor="$(echo "$phpInsVersion" | cut -d\. -f2)"
|
phpInsMinor="$(echo "$phpInsVersion" | cut -d\. -f2)"
|
||||||
# Is installed php version supported? (php 5.4 is EOL)
|
# Is installed php version newer than php5?
|
||||||
if [ "$(echo "$phpInsMajor.$phpInsMinor < 5.5" | bc )" == 0 ]; then
|
if [ "$(echo "$phpInsMajor.$phpInsMinor < 7.0" | bc )" == 0 ]; then
|
||||||
phpInsSupported=true
|
phpInsNewer=true
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
# Check if installed php is unsupported version (5.4 is EOL)
|
# Check if installed php is unsupported version (5.4 is EOL)
|
||||||
if [[ "$phpInsSupported" != true ]]; then
|
if [[ "$phpInsNewer" != true ]]; then
|
||||||
# Prefer the php metapackage if it's there
|
# Prefer the php metapackage if it's there
|
||||||
if ${PKG_MANAGER} install --dry-run php > /dev/null 2>&1; then
|
if ${PKG_MANAGER} install --dry-run php > /dev/null 2>&1; then
|
||||||
phpVer="php"
|
phpVer="php"
|
||||||
|
@ -181,7 +181,7 @@ if command -v apt-get &> /dev/null; then
|
||||||
phpVer="php5"
|
phpVer="php5"
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
# Supported php is installed, its common, cgi & sqlite counterparts are deps
|
# Newer php is installed, its common, cgi & sqlite counterparts are deps
|
||||||
phpVer="php$phpInsMajor.$phpInsMinor"
|
phpVer="php$phpInsMajor.$phpInsMinor"
|
||||||
fi
|
fi
|
||||||
# We also need the correct version for `php-sqlite` (which differs across distros)
|
# We also need the correct version for `php-sqlite` (which differs across distros)
|
||||||
|
|
Loading…
Reference in a new issue