This question already has an answer here:

I have "Ubuntu 14.04.2 LTS" OS and trying to install PHP7 using command:

sudo apt-get install php-7.0

Getting error message:

Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package php-7.0
E: Couldn't find any package by regex 'php-7.0'

sudo apt-get install php7.0
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package php7.0
E: Couldn't find any package by regex 'php7.0'

How it can be fix Please advise.

marked as duplicate by A.B., Pandya, Braiam, Pilot6, David Foerster Jan 3 '16 at 9:28

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • Your command doesn't match the output, since it has php-7.0 and the output has php7.0. Aside from that, there is no package with a name like that in the standard repositories. Are you trying to use a PPA? If so, perhaps askubuntu.com/a/705893/147763 can help. – Olathe Jan 2 '16 at 10:51
  • @Olathe: I have also tried commands: sudo apt-get install php-7.0 and sudo apt-get install php7.0 – Ramesh Chand Jan 2 '16 at 10:57
  • 5
    How to install php 7, see:askubuntu.com/q/705880/476968 – Tshilidzi Mudau Jan 2 '16 at 10:59
up vote 45 down vote accepted

PHP 7 is not available for Ubuntu Trusty in the standard Ubuntu repositories (2016-01-02).

You could use the PPA ppa:ondrej/php

sudo apt-add-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install php7.0
  • Thanks ! See the output of $php -v Below: PHP 7.0.1-4+deb.sury.org~vivid+1 (cli) ( NTS ) Copyright (c) 1997-2015 The PHP Group Zend Engine v3.0.0, Copyright (c) 1998-2015 Zend Technologies with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2015, by Zend Technologies – Ramesh Chand Jan 2 '16 at 13:01
  • 1
    PHP6 doesn't exist, see the PHP website – wb9688 Jan 2 '16 at 14:18
  • 1
    Not only does PHP 6 not exist, the naming scheme will change to php5.5, php5.6, etc. in coming versions. – muru Jan 2 '16 at 16:25
  • Need phpmyadmin, there is no php7.0-phpmyadmin, php5.6-phpmyadmin or php5.5-phpmyadmin, nor phpmyadmin compatible with your php. – happy_marmoset Oct 24 '16 at 7:21
  • Hello, I want to add php7.2 on my server in ubuntu 15.10. Is it possible? – Amit Kumar 10 hours ago

Not the answer you're looking for? Browse other questions tagged or ask your own question.