How do I upgrade PHP for Debian 7?

Linode Staff


We want to upgrade our PHP from PHP 5.4.45 version to PHP 5.6.33 version. Our plan contains backups, so we need to know how much time it would take to restore the backup if something goes wrong.

1 Reply

Hi there,

For Debian 7, the update and upgrade process would generally just require that you have the correct repos for the PHP version you're trying to install. You should be able to add these if you haven't yet and then complete the upgrade process by performing the following commands:

echo "deb wheezy-php56 all" >> /etc/apt/sources.list.d/dotdeb.list
echo "deb-src wheezy-php56 all" >> /etc/apt/sources.list.d/dotdeb.list
wget -O- | apt-key add -
apt-get update
apt-get install php5-cli php5-fpm ….. (or whatever package you might need)

That being said, if you already have the correct repos set up, it'd just be a matter of performing the following:

apt-get update
apt-get install php5-cli php5-fpm

Restoring from a backup can take several minutes depending on the size of your Linode, however for smaller Linodes this shouldn't take too long at all. For more information regarding Linode's backups service, you should be able to find some documentation by clicking here.

I hope that helps!


Please enter an answer

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct