VestaCP

How to Downgrade and Upgrade PHP 7.0 to PHP 7.1 or PHP 7.2 on Ubuntu VestaCP

In this tutorial I’ll show you how to upgrade PHP 7.0 which is by default installed by Vesta CP during installation to PHP 7.1.xx or 7.2.xx latest on Ubuntu server, I’ve personally tested all php version i.e. 7.1 and 7.2 before writing this tutorial and its just working fine without any issue hence it is safe to upgrade to PHP 7.1 or PHP 7.2 under vestacp or in Ubuntu/Debian.

Why upgrade to php 7.1. or 7.2? – Because it will give you security & performance boost + KICK, since WordPress or supported scripts will load much faster and uses less resources.

Package needed for the installation, you need to install software-properties-common :

For Apache mod_php :

For PHP 7.1 Upgrade :

First you need to add Ondrejs PPA :

if you get : “‘ascii’ codec can’t decode byte” run this command :

then run this commands :

Installing PHP 7.1 :

After installation disable php 7.0 module in order to activate the php7.1 module :

After you enabled the new php version module restart apach2 service :

For PHP 7.2 Upgrade :

First you need to add Ondrejs PPA (if you installed before then you can skip the PPA adding step) :

if you get : “‘ascii’ codec can’t decode byte” run this command :

then run this commands :

Installing PHP 7.2 :

After installation disable php 7.0 module in order to activate the php7.2 module :

After you enabled the new php version module restart apach2 service :

EXTRAS

To upgrade php7.1 to php 7.2 simply run this commands :

OR Downgrade php 7.2 to php 7.0 :

Downgrade php 7.2 to php 7.1 :

To install/downgrade php 5.6 and switch from PHP 7.x to php 5.6 :

Then switch to php 5.6 :

replace x with 0,1,2

upgrade php 5.6 to 7.x :

replace x with 0,1,2

Tui là jamesblackvn!

Gửi phản hồi

Website này sử dụng Akismet để hạn chế spam. Tìm hiểu bình luận của bạn được duyệt như thế nào.