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
PHP $Stmt->Num_Rows Doesnt Work by Prepared Statements
Empty Values Passed to Zend Framework 2 Validators
PHP - Count Frequency of Array Values
Install Yii2 Extension Manually Without Using Composer
PHP Loop: Add a Div Around Every Three Items Syntax
Php, Failed Connecting to Database
PHP - Getsqlvaluestring Function
Test PHP's Mail Function from Localhost
PHP Allocate Color Without Image Resource
How Is MVC Supposed to Work in Codeigniter
How to Post a Large Amount of Data Within PHP Curl Without Memory Overhead
Decoding Numeric HTML Entities via PHP
Check for Session Timeout in Laravel
PHP Adds Keys to Decoded and Then Encoded JSON Data
Sort Array by Length and Then Alphabetically
How to Change Default Redirect Url of Laravel 5 Auth Filter
Phpexcel_Writer_Exception with Message "Could Not Close Zip File PHP://Output."