diff --git a/src/scripts/unix.sh b/src/scripts/unix.sh index fb8839bf..e595bef0 100644 --- a/src/scripts/unix.sh +++ b/src/scripts/unix.sh @@ -92,7 +92,7 @@ configure_php() { # Function to get PHP version in semver format. php_semver() { - php -v | grep -Eo -m 1 "[0-9]+\.[0-9]+\.[0-9]+((-?[a-zA-Z]+([0-9]+)?)?){2}" | head -n 1 + grep -Eo 'version="[0-9]+(\.[0-9]+){2}((-?[a-zA-Z]+([0-9]+)?)?){2}' "$(command -v php-config)" | cut -d '"' -f 2 } # Function to get the tag for a php version.