Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save shoaibali/1ba410bb42d8d9cff160635f7ad79efa to your computer and use it in GitHub Desktop.
Save shoaibali/1ba410bb42d8d9cff160635f7ad79efa to your computer and use it in GitHub Desktop.
multiple versions of php on Ubuntu Xenial 16.04 down grade to php5.6 from php7
# reference1: https://by-example.org/ubuntu-16-04-xenial-downgrade-php-7-to-php-5-6/
# reference2: https://askubuntu.com/questions/761713/how-can-i-downgrade-from-php-7-to-php-5-6-on-ubuntu-16-04/761735
# reference2 (recommended)
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install php7.0 php5.6 php5.6-mysql php-gettext php5.6-mbstring php-xdebug libapache2-mod-php5.6 libapache2-mod-php7.0
# from php5 to php7
sudo a2dismod php5.6 ; sudo a2enmod php7.0 ; sudo service apache2 restart
# from php7 to php5
sudo a2dismod php7.0 ; sudo a2enmod php5.6 ; sudo service apache2 restart
sudo update-alternatives --config php
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment