Hello everyone, I can’t install PHP 7 version on Ubuntu 14.04, I found the instructions, but half of those commands don't work, for example,

sudo add-apt-repository ppa:ondrej/php 

Can anyone give instructions? Thank.

  • Please tell us the version of Ubuntu - cheops
  • the version of ubuntu, as well as the link to the instruction which was used and did it give any errors when they tried to use these instructions? - Alexey Shimansky
  • ubuntu 14.04 :))) - denis davydenko

1 answer 1

If you have a clean Ubuntu, then:

 sudo apt-add-repository ppa:ondrej/php sudo apt-get update sudo apt-get install php7.0 

If PHP is installed (for example php5), then:

 sudo apt-get update sudo apt-get purge php5-common -y sudo apt-get install php7.0 php7.0-fpm php7.0-mysql -y sudo apt-get --purge autoremove -y 


For versions: Ubuntu 14.04 / 15.10
Starting from Ubuntu 16.04 - PHP7 is set by default ...

  • prntscr.com/avzdiz - denis davydenko
  • Corrected a question. Now everything is clear. Should work. - Urmuz Tagizade
  • prntscr.com/avzsa7 - denis davydenko
  • toster.ru/q/149649 - Urmuz Tagizade
  • Since yesterday, this does not work for me, writes E: Unable to locate package php7.0 E: Couldn't find any package by regex 'php7.0' After adding the repository, you can only install php5. And when installing php7.0 or php5.6 it says that there are no such packages. - TF03