0

I'm using Vagrant box (Homestead actually) with Ubuntu. When I use PHP 5.6 box for

php -v

I'm getting:

PHP 5.6.13-1+deb.sury.org~trusty+3 (cli)

so it's clear that's PHP 5.6.13.

But when running box with PHP 7 I'm getting:

PHP 7.0.0-2+deb.sury.org~trusty+1 (cli) ( NTS )

and I'm really not sure if it's PHP 7.0 or if it's PHP 7.0.2 (I don't understand what -2 is here in PHP version).

I'm running Ubuntu 14.04.3 LTS (GNU/Linux 3.19.0-25-generic x86_64) in this box

When I run:

dpkg --get-selections | grep php

I'm getting:

php-common                                      install
php-curl                                        install
php-gd                                          install
php-imap                                        install
php-mysql                                       install
php-pgsql                                       install
php-sqlite3                                     install
php7.0-cli                                      install
php7.0-common                                   install
php7.0-curl                                     install
php7.0-dev                                      install
php7.0-fpm                                      install
php7.0-gd                                       install
php7.0-imap                                     install
php7.0-json                                     install
php7.0-mysql                                    install
php7.0-opcache                                  install
php7.0-pgsql                                    install
php7.0-sqlite3                                  install

When I run:

sudo apt-get upgrade php-common

I'm getting at the moment:

php-common is already the newest version.
php-common set to manually installed.

So the question is - if it's PHP 7.0 and not 7.0.2 how can I easy update to latest 7.0.2 or maybe it's not available yet as package for Ubuntu?

EDIT

As suggested I've run:

sudo apt-get update

and

sudo apt-get upgrade

There was info about installing PHP 7.0.2 however when I run php -v I'm still getting:

PHP 7.0.0-2+deb.sury.org~trusty+1 (cli)

And now when I run

 sudo apt-get upgrade

I'm getting:

vagrant@homestead:~$ sudo apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages have been kept back:
  libssl-dev nfs-common openssl php7.0-cli php7.0-dev php7.0-fpm
0 upgraded, 0 newly installed, 0 to remove and 6 not upgraded.

And when I run:

apt-cache policy php7.0-cli

I'm getting:

vagrant@homestead:~$ apt-cache policy php7.0-cli
php7.0-cli:
  Installed: 7.0.0-2+deb.sury.org~trusty+1
  Candidate: 7.0.2-4+deb.sury.org~trusty+1
  Version table:
     7.0.2-4+deb.sury.org~trusty+1 0
        500 http://ppa.launchpad.net/ondrej/php-7.0/ubuntu/ trusty/main amd64 Packages
 *** 7.0.0-2+deb.sury.org~trusty+1 0
        100 /var/lib/dpkg/status
5
  • Package search using php7 keyword returns nothing for Ubuntu 14.04 (trusty). PHP 7 only exists for 16.04 (xenial), according to this search result.
    – user37165
    Jan 20, 2016 at 17:57
  • 1
    @clearkimura You should read my answer - you'll see it's from a PPA and not a package in the standard repositories.
    – Thomas Ward
    Jan 20, 2016 at 18:00
  • 1
    If apt-get update && apt-get upgrade doesn't solve your problem please attach output of apt-cache policy php7.0-cli.
    – oerdnj
    Jan 22, 2016 at 12:16
  • @oerdnj Please look at my edit Jan 30, 2016 at 12:34
  • Ok, now try apt-get dist-upgrade and if that doesn't work, it's some vagrant configuration you are using. But hey, this is really basics of a system administration, you should have done this before you came here to ask.
    – oerdnj
    Feb 5, 2016 at 6:25

1 Answer 1

4

First part, what's installed.

This all goes back to package versioning schemes, and why you're getting confused. So, lets dissect it into its individual parts. Assuming it conforms to typical Debian versioning and such, then...

Take php7 you stated:

PHP 7.0.0-2+deb.sury.org~trusty+1

This string is dissected as follows:

  • PHP = the software name
  • 7.0.0 = the version of that software (from PHP's own versioning schemes)
  • -2 = the Package Revision number - that is, how many different packaging changes have been done - this would be the "Second Package" which means they made changes to the packaging or applied patches through quilt in the second version.
  • +deb.sury.org indicates the repository source - it's from deb.sury.org repos, which are actually PPAs running on Launchpad, with packages made by the one who runs the deb.sury.org website.
  • ~trusty+1 - This indicates additional version specific changes done for the repository - this is an Ubuntu Trusty, package, and likely is either the first or second revision of the package (depending on if they ever had +0 or not) specific for Trusty.

TL;DR: This is a PHP 7.0.0 package, but it has had a couple of revisions since the initial PHP 7.0.0 package.


Second part, how to get PHP 7.0.2.

The repository you are using is a PPA - likely this one.

It was informed to me that 7.0.2 is available and you need to run apt-get update && apt-get upgrade. That should put you on the right versions. If it doesn't, then try using apt-get dist-upgrade as there may be other dependencies that need added and the upgrade was held back because of that.

4
  • 1
    JFTR; the PPA is already at PHP 7.0.2 since 2016-01-14, so the thing he is missing is plain apt-get update && apt-get upgrade and OPs PHP 5.6 also looks outdated.
    – oerdnj
    Jan 21, 2016 at 9:23
  • Please look at my edit Jan 30, 2016 at 12:32
  • @MarcinNabiałek go see mine.
    – Thomas Ward
    Jan 30, 2016 at 13:47
  • apt-get dist-upgrade solved the issue in this case. I have now PHP 7.0.2-4+deb.sury.org~trusty+1. Thank you for your help Jan 30, 2016 at 16:15

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .