How to switch PHP Versions on LAMP Server

sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get remove php7.0
sudo apt-get install php7.1

sudo apt-get install php7.1-xml
sudo apt-get install php7.1-mysql
sudo apt-get install php7.1-gd
sudo apt-get install php7.1-mbstring
sudo apt-get install php7.1-zip
sudo apt-get install php7.1-cli

sudo a2dismod php7.2
sudo a2enmod php7.1

sudo update-alternatives --set php /usr/bin/php7.1

sudo systemctl restart apache2

Leave a Reply

Your email address will not be published. Required fields are marked *


The reCAPTCHA verification period has expired. Please reload the page.