I ran into a lot of problems using this script. After running through it manually, and installing php7.2 when I noticed it wasn't included in the list, everything worked fine.
export DEBIAN_FRONTEND=noninteractive
add-apt-repository universe
apt update
-apt install -y git apache2 curl php7.2-fpm php7.2-curl php7.2-mbstring php7.2-ldap \
+apt install -y git apache2 php7.2 curl php7.2-fpm php7.2-curl php7.2-mbstring php7.2-ldap \
php7.2-tidy php7.2-xml php7.2-zip php7.2-gd php7.2-mysql mysql-server-5.7 libapache2-mod-php7.2
# Set up database