Fix PHP version detection

This commit is contained in:
Robert Partridge 2022-07-14 02:11:39 -04:00
parent 5b8c65d8a4
commit 37f6302e62
1 changed files with 5 additions and 2 deletions

View File

@ -8,8 +8,11 @@ if [ "$EUID" -ne 0 ]
exit
fi
# update system
apt update && apt upgrade -y && apt autoremove -y && apt clean
# get PHP version
PHP="7.4"
PHP=`apt search php | grep fpm | grep security | cut -c 4-6`
# install needed packages
apt install php-dev -y
@ -21,7 +24,7 @@ cd php-ext-brotli
phpize
./configure
make install clean
echo "extension=brotli.so" > /etc/php/7.4/mods-available/brotli.ini
echo "extension=brotli.so" > /etc/php/${PHP}/mods-available/brotli.ini
phpenmod brotli
# clean up packages