Você pode instalá-lo adicionando o repositório e usando as funções normais de gerenciamento de pacotes do apt.
#!/bin/bash
sudo apt update
sudo apt install apt-transport-https lsb-release ca-certificates -y
sudo wget -O /etc/apt/trusted.gpg.d/php.gpg \
https://packages.sury.org/php/apt.gpg
echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" |
sudo tee /etc/apt/sources.list.d/php.list
sudo apt update
# 7.1 is out so select your number accordingly
sudo apt install php7.X -y