You get a bonus - 1 coin for daily activity. Now you have 1 coin

Installing PHP 5.3 on Debian Lenny (latest versions)

Practice



On Debian Lenny, PHP 5 is version 5.2.6. However, support for PHP 5.2 has been dropped, and its last version, 5.2.17, will apparently not be updated any further.

What should we do if we have a Debian Lenny server, and for some reason we don't want to upgrade to Squeeze, but we need PHP 5.3 specifically, and moreover we want it to always be fresh and up to date?


Let's do it.


1) Go to the /etc/apt directory and edit the sources.list file. We need to add the following lines to it:

deb http://php53.dotdeb.org oldstable all
deb-src http://php53.dotdeb.org oldstable all


2) Now we need to add the key for installation.

$ sudo gpg --keyserver keys.gnupg.net --recv-key 89DF5277
$ sudo gpg -a --export 89DF5277 | sudo apt-key add -

If it didn't work (this happens for various reasons... for example, the server is busy) - you can import the key manually:

$ cd ~
$ wget http://www.dotdeb.org/dotdeb.gpg
$ sudo apt-key add - < dotdeb.gpg


3) Update apt

$ sudo apt-get update


4) And, finally, install PHP

$ sudo aptitude install php5

This command will install the latest available PHP 5.3 right away (5.3.6 at the time this article was written, or a newer one - whatever is current at the moment).

I also recommend running the command:

$ aptitude search php5


which will show you which additional modules can be installed for PHP5.


Thanks to dotdeb.org for looking after Debian administrators.

Applies to: Debian Lenny only + PHP 5.3

created: 2017-05-09
updated: 2026-03-09
477



Was this answer useful?
Choose a quick rating so we can improve the next answer for you.
How satisfied are you?


Comments

To leave a comment

If you have any suggestion, idea, thanks or comment, feel free to write. We really value feedback and are glad to hear your opinion.
To reply

Lectures and tutorial on "Running server side scripts using PHP as an example (LAMP)"

Terms: Running server side scripts using PHP as an example (LAMP)