As from Ubuntu 16.04 the default PHP version is 7. Should you want to install the PHP5 packages, you need to add a repository.

Lets add two repositories, one for Apache2 and PHP5

#add-apt-repository ppa:ondrej/apache2
#add-apt-repository ppa:ondrej/php

After adding the repositories, update APT:-

#apt-get update

Once the update is done, you are ready to install packages. Use apt-cache search to look for packages:-

#apt-cache search php5

Sample output from that command:-

php5.6-dev – Files for PHP5.6 module development
php5.6-common – documentation, examples and common module for PHP
php5.6 – server-side, HTML-embedded scripting language (metapackage)
php5.6-curl – CURL module for PHP
php5.6-gd – GD module for PHP
php5.6-imap – IMAP module for PHP

PHP 5.6 on Ubuntu 16.04 LTS

Leave a Reply

Your email address will not be published. Required fields are marked *