...
The first thing to do is to add the lenny repository to the end of /etc/apt/sources.list:deb http://archive.debian.org/debian lenny main contrib non-free
Then you need to make sure that your favourite PHP packages will be downloaded from lenny instead of squeeze. You can do this creating the file /etc/apt/preferences.d/lenny, with this stuff inside:Explanation: choose Lenny as installation source if the package is not already installed and not available from Squeeze
*Package: **
Pin: release n=lenny*
Pin-Priority: 100
...