How to install php-5 in Ubuntu?

Asked

Viewed 545 times

5

I’m a new user on Ubuntu, and I’m unable to install the PHP-5 via apt-get, since the stable version is PHP-7, get an error saying no package was found. I tried using the following commands

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

But to no avail.

Does anyone know how to install?

  • Are you getting any error?

1 answer

5


After PHP has made the version 7 of stable PHP, it seems that the PHP PPA has changed and it is necessary to update it.

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

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

Behold:

 sudo apt-get install php5.6 php5.6-common php5.6-mcrypt
  • Thanks for your help, I’ll test it as soon as I can.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.