DWQA QuestionsCategory: PHPHow to Install PHP5.6 in ubuntu?
asked 6 years ago

Solution :
Step1: Remove previos installed php version using following command.

¬†sudo apt-get purge `dpkg -l | grep php| awk ‘{print $2}’ |tr “\n” ” “`

Step2: Add the PPA

sudo add-apt-repository ppa:ondrej/php

Step3: Install your PHP Version

sudo apt-get update
sudo apt-get install php5.6

Step4: Install php5.6 modules 

sudo apt-get install php5.6-mbstring php5.6-mcrypt php5.6-mysql php5.6-xml

Step5: Verify your version

sudo php -v