Using phpinfo(), I have found that the installed version of PHP is 7.0.26. I want to upgrade it to PHP 7.2.
Asked
Active
Viewed 940 times
0
-
here you can find an old answer: https://askubuntu.com/questions/856793/upgrade-to-the-specific-php-7-1-from-php-7-0-in-ubuntu-16-04 – Samer Abu Gahgah Dec 28 '17 at 06:52
1 Answers
0
You have to install the PHP 7.2 (or any higher version 7.x) and remove your old version if you don't need it any more.
First add the PPA ppa:ondrej/php, run:
sudo add-apt-repository ppa:ondrej/php
sudo apt update
Second install the version you need 7.2 in your case, run:
sudo apt install php7.2
Third if you want to remove your old existing version, run
sudo apt remove php7.0

Samer Abu Gahgah
- 281
-
Probably the php module for apache2 should be installed and enabled:
sudo apt install libapache2-mod-php7.x && a2enmod php7.x
, wherex
refers to the certain version.. – pa4080 Dec 28 '17 at 11:05