Como instalar o PHP 7.3 no Ubuntu
Add PPA for PHP 7.3
sudo apt install software-properties-common
sudo add-apt-repository ppa:ondrej/php
sudo apt update
Install PHP 7.3
After you’ve added the repository, you can install PHP 7.3 with the following command:
apt-get install php7.3
This command will install additional packages:
libapache2-mod-php7.3
libaprutil1-dbd-sqlite3
php7.3-cli
php7.3-common
php7.3-json
php7.3-opcache
php7.3-readline
php7.3-mysql
php7.3-dom
php7.3-curl
php7.3-zip
php7.3-fpm (opcional)
php7.3-dev
php7.3-xmlrpc
php7.3-gd (necessário para o nextcloud)
php7.3-mbstring
php7.3-xml
libapache2-mod-php
php7.3-intl
php7.3-imagick
…and others.
And that’s it. To check if PHP 7.3 is installed on your server, run the following command:
php -v
Install PHP 7.3 modules
You may need additional packages and modules depending on your applications. The most commonly used modules can be installed with the following command:
apt-get install php-pear php7.3-curl php7.3-dev php7.3-gd php7.3-mbstring php7.3-zip php7.3-mysql php7.3-xml
And that’s all. You can now start using PHP on your Ubuntu server.
If you want to further tweak and configure your PHP, read our instructions below.
Alterar o PHP padrão
$ sudo a2dismod php7.2 //Desativa o php
$ sudo a2enmod php7.3 //Ativa o php desajado
$ sudo update-alternatives –set php /usr/bin/php7.3 // seta como padrão
$ sudo systemctl restart apache2 // reinicia o apache.