Like Valdeir remembered well, if your Ubuntu is 17.10 or lower follow these steps:
Make sure you have the following package installed so you can add repositories:
apt install python-software-properties
Add the Ondřej repository
add-apt-repository ppa:ondrej/php
That naughty update
apt update
Installation of php 7.2:
Apache and Zip installation
apt install -y apache2 zip
Installation of PHP and some extensions
apt-get install -y php7.2-mysql php7.2-curl php7.2-json php7.2-cgi php7.2 php7.2-mbstring libapache2-mod-php7.2 php7.2-ldap php-xdebug wget
Creation of the info.php file
echo "<?php phpinfo() ?>" > /var/www/html/info.php
Remembering: service apache2 start // inicia o serviço do apache
And why you do not install with apt-get?
– Karl Zillner
Extract the file in a folder that does not contain spaces and then try again.
– Valdeir Psr
This enters as programming ?
– rbz
@RBZ This question, in my opinion, can remain because it is related to "common tools among programmers"
– Valdeir Psr