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
php7
keyword returns nothing for Ubuntu 14.04 (trusty). PHP 7 only exists for 16.04 (xenial), according to this search result.apt-get update && apt-get upgrade
doesn't solve your problem please attach output ofapt-cache policy php7.0-cli
.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.