I am running a WordPress website over LEMP stack server on Ubuntu 18.04 on DigitalOcean. WordPress is recommending me to update my PHP to the latest version.
I am running PHP 7.2.17; Please tell me the safest way to update my PHP to the latest version PHP 7.3.
Open the terminal and type:
php7.3 will be updated automatically when updates become available. Alternatively you can build php7.3 from source in Ubuntu 18.04, but it will not be updated automatically, and it also takes more than an hour to build if you want to test it too.
After installing php7.3 you can show php7.3 modules that can also be installed by running the following command:
A quick one-line command to install the same packages on php7.3 as php7.2:
From @karel's answer I replace the first command from
sudo add-apt-repository ppa:ondrej/php
tosudo apt-add-repository ppa:ondrej/php
and it works for me. So finally I run: