How to install php-5 on ubuntu? [closed]

5

I am new user in Ubuntu , and I am not able to install PHP-5 via apt-get, since the stable version is PHP-7 , I get an error saying that no packages were found. I tried to use the following commands

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

But with no success at all.

Does anyone know how I can install?

    
asked by anonymous 28.09.2016 / 13:10

1 answer

5

After PHP has made the 7 version of PHP stable, it looks like the PHP PPA has changed and needs updating.

  sudo add-apt-repository ppa:ondrej/php
  sudo apt-get update

Another important thing is that now it is necessary to specify which version of PHP you will install (whether it is 5.5, 5.6 or 7.0).

See:

 sudo apt-get install php5.6 php5.6-common php5.6-mcrypt
    
28.09.2016 / 14:03