Thứ Bảy, 19 tháng 8, 2017

How to Install PHP 5.6 or PHP 7.1 on Ubuntu 16.04, 14.04 using PPA

Install PHP 5.6 on Ubuntu

Use the following set of command to add PPA for PHP 5.6 in your Ubuntu system and install PHP 5.6.
$ sudo apt-get install python-software-properties
$ sudo add-apt-repository ppa:ondrej/php
$ sudo apt-get update
$ sudo apt-get install -y php5.6
apt-get install libapache2-mod-php5.6 php5.6-cli php5.6-common php5.6-curl php5.6-gd php5.6-mysql php5.6-mysqli php5.6-json php5.6-mcrypt php5.6-odbc php5.6-xmlrpc php5.6-mbstring php5.6-soap php5.6-xml -y

Switch Between PHP Version’s

If you have installed multiple php versions and want to use different than default. Use following steps to switch between php5.6 and php7.1 version. You can use the same command for other php versions.

From PHP 5.6 => PHP 7.1

Apache:-

$ sudo a2dismod php5.6
$ sudo a2enmod php7.1
$ sudo service apache2 restart

CLI:-

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

Share This!


Không có nhận xét nào:

Đăng nhận xét