While doing an update, I got this fun message:
php5 (5.4.45-0+deb7u2) wheezy-security; urgency=medium
* PHP 5.4 has reached end-of-life on 14 Sep 2015 and as a result there
will be no more new upstream releases. The security support of PHP
5.4 in Debian will be best effort only and you are strongly advised
to upgrade to latest stable Debian release that includes PHP 5.6 that
will reach end of security support on 28 Aug 2017.
-- OndÅej Surý <[email protected]> Sun, 04 Oct 2015 17:05:37 +0200
Time to upgrade!
After a bit of digging around here is how I did it. Â I’m moving from PHP 5.4 to PHP 5.6
# php --version
PHP 5.4.45-0+deb7u2 (cli) (built: Oct 17 2015 09:01:48)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2014 Zend Technologies
Ok, so here is the version I’m starting with on Debian 7.9 (Wheezy). During this process, I’m using unsigned packages so get used to this fine message, and packages being held back, unless I manually install them:
Reading package lists... Done
W: GPG error: http://packages.dotdeb.org wheezy Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY E9C74FEEA2098A6E
W: GPG error: http://packages.dotdeb.org wheezy-php56-zts Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY E9C74FEEA2098A6E
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
But if you can read this, then it worked!
First add these to the /etc/apt/sources.lst file:
deb http://packages.dotdeb.org wheezy all
deb-src http://packages.dotdeb.org wheezy all
deb http://packages.dotdeb.org wheezy-php56-zts all
deb-src http://packages.dotdeb.org wheezy-php56-zts all
Then we can run the usual apt-get update / apt-get upgrade shuffle.
On my first run I got this fun output:
The following packages have been kept back:
libapache2-mod-php5 libmysqlclient18 mysql-server php-pear php5 php5-cli
php5-common php5-gd php5-mysql
The following packages will be upgraded:
mysql-common
1 upgraded, 0 newly installed, 0 to remove and 9 not upgraded
So I went ahead and updated mysql-common. Â And during that upgrade I got the new message:
WARNING: The following packages cannot be authenticated!
mysql-common
Install these packages without verification [y/N]? y
So yes these packages are all unsigned. 🙁
After this, I ran:
# apt-get install php5
And got the following scary looking output
The following extra packages will be installed:
libapache2-mod-php5 libt1-5 libvpx1 php5-cli php5-common php5-gd php5-mysql
Suggested packages:
php5-user-cache
Recommended packages:
php5-readline
The following NEW packages will be installed:
libt1-5 libvpx1
The following packages will be upgraded:
libapache2-mod-php5 php5 php5-cli php5-common php5-gd php5-mysql
6 upgraded, 2 newly installed, 0 to remove and 3 not upgraded.
Need to get 7,659 kB of archives.
After this operation, 5,220 kB of additional disk space will be used.
Do you want to continue [Y/n]? y
WARNING: The following packages cannot be authenticated!
php5-mysql php5-cli php5-gd libapache2-mod-php5 php5-common php5
Install these packages without verification [y/N]? y
And then finally, after another apt-get update / apt-get upgrade I finally get this output:
The following packages have been kept back:
libmysqlclient18 mysql-server
0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.
So just update the held back packages and get it over with.
apt-get install libmysqlclient18 mysql-server
Ugh, it isn’t pretty. Â But now we are on the newer train of PHP!
# php --version
PHP 5.6.14-1~dotdeb+zts+7.1 (cli) (built: Oct 2 2015 03:39:20)
Copyright (c) 1997-2015 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2015 Zend Technologies
with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2015, by Zend Technologies
Hopefully things continue to work.