apt-get update apt-get install python-software-properties apt-get install software-properties-common apt-get update
apt-get install zip unzip
add-apt-repository ppa:ondrej/php
If you get error here about Python Unicode, then it’s a problem of locale language set in your local machine. To fix you need to update locale and set, follow these steps:
locale-gen en_US.UTF-8 export LANG=en_US.UTF-8 export LC_ALL=en_US.UTF-8
apt-get update
apt-get install php7.2
apt-get install php7.2-curl php7.2-mysql apt-get install libapache2-mod-php7.2 php7.2-mbstring php7.2-xml php7.2-opcache php7.2-gd php7.2-zip
php -v