Debian – How to Upgrade PHP to a Higher Version for Debian Squeeze

debiandebian-squeezePHP

Currently, my PHP is on 5.3.3, how can I upgrade it? Also how can I upgrade anything? For example, if I want to upgrade phpMyAdmin as well?

Best Answer

Upgrade all packages:

apt-get update; apt-get upgrade;

If you want to upgrade just one package (e.g. php5):

apt-get update; apt-get install php5;

For the package versions available on Debian take a look at:

http://www.debian.org/distrib/packages

If you want to install php5 5.4.4-2, that is only available on wheezy, you should add wheezy to your /etc/apt/sources.list:

deb http://ftp.us.debian.org/debian/ wheezy main non-free contrib

and then:

apt-get update
apt-get install -t wheezy php5

To don't get any surprises, you should use apt pinning in order to prevent that your system from installing packages from wheezy, just create the file /etc/apt/preferences

Package: *
Pin: release n=squeeze
Pin-Priority: 650

Package: *
Pin: release n=wheezy
Pin-Priority: -10

So when that when you do apt-get install, if you don't specify -t wheezy it will by default install the package from squeeze.

Related Topic