I have been trying to update my system's php from 5.4.45 to 7.0. Is it even possible? How do i do it?

Following are the results of my commands to update the php version.

uname -a

> Linux Debian-70-wheezy-64-minimal 3.2.0-4-amd64 #1 SMP Debian 3.2.68-1+deb7u4 x86_64 GNU/Linux

php --version

>PHP Deprecated:  Comments starting with '#' are deprecated in /etc/php5/cli/conf.d/ming.ini on line 2 in Unknown on line 0
PHP 5.4.45-0+deb7u1 (cli) (built: Sep 10 2015 08:34:47)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2014 Zend Technologies

apt-get update

>W: GPG error: http://repo.mysql.com wheezy Release: The following signatures were invalid: KEYEXPIRED 1487236823 KEYEXPIRED 1487236823 KEYEXPIRED 1487236823

apt-get update command is stopped on the above error. I tried to search internet but they are saying that first I have to remove php5. I don't want to take risk. Is there any better solution?

  • You might not want to do that, at least not without testing all your vhost in a test server. v7 is largely incompatible with v5. Commented Aug 6, 2017 at 12:19

1 Answer 1


You will have to update the GPG keys to the repo. Run this :

apt-key adv --keyserver pgp.mit.edu --recv-keys A4A9406876FCBD3C456770C88C718D3B5072E1F5

And then :

apt-get update && apt-get upgrade

You should then be able to install a higher version of mysql.

  • the error is not showing now. Now how do I update to latest version from 5.4.45? thanks for help Commented Jul 30, 2017 at 22:10
  • I edited the answer. Run apt-get upgrade Commented Jul 30, 2017 at 22:14
  • This is the error now imgur.com/a/PAiXr Commented Jul 30, 2017 at 22:16
  • Maybe this answer can help you. stackoverflow.com/a/29201696/7499402 Commented Jul 30, 2017 at 22:19
  • I tried these but still it's showing me the same version 5.4.45. Is it even possible to go beyond this version in debian 7.9? Commented Jul 30, 2017 at 22:26

You must log in to answer this question.

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