Ubuntu 16.04 comes with PHP7 as a standard, so there are no PHP5 packages
However, if you like, you can add PPA to receive these packages:
Remove all packages php package
List of installed php packages with dpkg -l | grep php| awk '{print $2}' |tr "\n" " " dpkg -l | grep php| awk '{print $2}' |tr "\n" " " dpkg -l | grep php| awk '{print $2}' |tr "\n" " " , then remove the unwanted packages with sudo aptitude purge your_packages_here or if you want to remove them all, use:
sudo aptitude purge `dpkg -l | grep php| awk '{print $2}' |tr "\n" " "`
Add PPA
sudo add-apt-repository ppa:ondrej/php
Install PHP Version
sudo apt-get update sudo apt-get install php5.6
You can also install php5.6 modules.
Check your version
sudo php -v
Based on https://askubuntu.com/a/756186/532957 (thanks @AhmedJerbi)
Rodrigo Stadler Apr 22 '16 at 9:04 on 2016-04-22 09:04
source share