Crimson1222 Crimson1222 - 2 years ago 1756
PHP Question

How to install the latest version of PHP 5.4 on Debian 8 (Jessie)?

I'm trying to install PHP on Debian 8 for a project I'm working on. The project requires PHP 5.4 and can't any of the later versions of PHP (5.5 and 5.6). Whenever I install php5 using apt-get, it installs the latest available version of PHP 5.6. How do I install PHP 5.4.44 (or whatever the latest version of PHP 5.4 actuall is)?

Answer Source

You need to add the old stable (wheezy) repos to the apt sources lists . Create a file at:


And add following content:

deb wheezy main contrib non-free
deb-src wheezy main contrib non-free

run following commands to update the repo infos and install php5.4.44

apt-get update
apt-get install php5=5.4.44-0+deb7u1

You should think about version pinning. You could do that similar to:

Create a file at:


Package: php5*
Pin: release a=oldstable
Pin-Priority: 700

Package: php-*
Pin: release a=oldstable
Pin-Priority: 700
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download