Não consigo instalar o PHP5 no Ubuntu 16.04 [duplicado]

12
root@areeb-Inspiron-3420:/var/www/html# apt install php5
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package php5 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'php5' has no installation candidate
root@areeb-Inspiron-3420:/var/www/html# apt-get install libapache2-mod-php5
Reading package lists... Done
Building dependency tree... 50%
Building dependency tree       
Reading state information... Done
Package libapache2-mod-php5 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'libapache2-mod-php5' has no installation candidate

O que devo fazer agora?

    
por Areeb Durani 18.05.2016 / 15:07

2 respostas

2

16.04 não possui o PHP 5 nos repositórios oficiais. Instale um sistema 14.04 ou use este PPA .

    
por fkraiem 18.05.2016 / 15:37
19

O Ubuntu 16.04 LTS vem com o PHP 7.0. Para instalá-lo, você precisa executar:

sudo apt-get install php

Ou melhor, escolha um PHP Web SAPI específico, provavelmente você precisa de suporte para o Apache2:

sudo apt-get install libapache2-mod-php php

Ou PHP FPM

sudo apt-get install php-fpm php

Se você precisa especificamente do PHP 5.x, você precisará usar ppa:ondrej/php e instalar, por exemplo. PHP 5.6 para o Apache2:

sudo apt-get install php5.6 libapache2-mod-php5.6
    
por oerdnj 18.05.2016 / 18:24

Tags