Package PHP5 Have No Installation Candidate (Ubuntu 16.04)

Package php5 have no installation candidate (Ubuntu 16.04)

Ubuntu 16.04 comes with PHP7 as the standard, so there are no PHP5 packages

However if you like you can add a PPA to get those packages anyways:

Remove all the stock php packages

List installed php packages with dpkg -l | grep php| awk '{print $2}' |tr "\n" " " then remove unneeded packages with sudo aptitude purge your_packages_here or if you want to directly remove them all use :

sudo aptitude purge `dpkg -l | grep php| awk '{print $2}' |tr "\n" " "`

Add the PPA

sudo add-apt-repository ppa:ondrej/php

Install your PHP Version

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

You can install php5.6 modules too ..

Verify your version

sudo php -v

Based on https://askubuntu.com/a/756186/532957 (thanks @AhmedJerbi)

Package php5 has no installation candidate on Ubuntu 16.04 LTS

Ubuntu 16.04 comes with PHP7 ,there are no PHP5 packages.
Remove all php7 packages:

sudo aptitude purge `dpkg -l | grep php| awk '{print $2}' |tr "\n" " "

New PPA

sudo add-apt-repository ppa:ondrej/php

Update packages:

sudo apt-get update

Install PHP:

sudo apt-get install php5.6

Check PHP Version:

php -v

Debian 9: the php5 packages is not installed

The package libapache2-mod-php5.6, php5-dev, php5-mysql,php5-curl can be installed only on debian Wheezy (7) , Jessie (8) or Sid . Also the ondrej/php repository does not provide those package for debian Stretch it is only provide the php5.6 package.

The command sudo apt-get install php-dev will install the development module for PHP7 :

dh-php libssl-dev libssl-doc php7.1-cli php7.1-common php7.1-dev php7.1-json 
php7.1-opcache php7.1-readline pkg-php-tools shtool xml2

PHP5-Curl install error no installation candidate

Use sudo apt-get install php5.6-curl



Related Topics



Leave a reply



Submit