Using PHP PPA to install PHP 5.6 with PHP 7.0 In UBUNTU

Using PHP PPA to install PHP 5.6 with PHP 7.0
There's an option to co-install PHP 5.6 packages using ppa:ondrej/php.
Assuming libapache2-mod-php is a suitable way to enable PHP in Apache for you, you can proceed in this way:
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
Switch PHP version ( Apache ):
  • from php5.6 to php7.0:
    sudo a2dismod php5.6 ; sudo a2enmod php7.0 ; sudo service apache2 restart
  • from php7.0 to php5.6:
    sudo a2dismod php7.0 ; sudo a2enmod php5.6 ; sudo service apache2 restart

Comments

Popular posts from this blog

Backup & Restore Database as SQL Dump by SqlYog

Postfix can support per-domain outgoing IP addresses, but is not currently configured to do so

Wanna-cry-ransomware