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.
OMG ditch PHP and WordPress 🙂
I’d love to pay someone to write me a system that works on IIS 4 + ASP/SQL 4.21 and is usable on IE 3.0 and higher. But I don’t see that happening anytime soon.
I don’t think that WordPress supports IE3.0 either. Sarcasm aside there are new CMS systems that don’t use PHP and suck less. Even Python based. Also there is new paradigm of static page generation via CMS. You don’t edit 5 year old blog posts that often and static pages use lot less server resources compared to dynamic.
Yeah, it’s basically what this ‘cache’ pluggin does, is it builds the pages as requested, then just serves static pages. Themes change, and I guess for companies, advertising etc as they will have different embedded tracking and advertising.
Once I get some push on various projects cross compiling, then I’ll look into replacing wordpress… although when it runs, it is pretty low maintenance.
WordPress surely is. But PHP is not low maintenance from sysadmin point of view. In fact it’s a nightmare.
Try Mezzanine or Django-CMS
Just wondering…why stick to Wheezy?
no systemd ….. I’m too hands off to make such a massive switch. Maybe when it’s a few versions older.
When I do this, it wants to install apache and mysql. I use nginx and mariadb. How can I upgrade from php5.4 to 5.6 without installing these? Also if I’m using php-fpm, does the upgrade process change?
I suspect at that point you’ll either need to find another repo, or just move up to the systemd versions of Debian.