Get snapshots de php5.3.x from http://php.net
http://fr.php.net/get/php-5.3.0.tar.gz/from/this/mirror
...for example
tar -zxf php-5.3.0.tar.gz
cd php-5.3.0
make distclean
./configure --with-apxs2=/usr/bin/apxs2 -prefix=/opt/php --with-mysql=/usr --with-mysqli=/usr/bin/mysql_config --with-tidy=/usr --with-curl=/usr/bin --with-curlwrappers --with-openssl-dir=/usr --with-zlib-dir=/usr --enable-mbstring --with-pdo-mysql=/usr --with-xsl=/usr --with-ldap --with-xmlrpc --with-iconv-dir=/usr --with-snmp=/usr --enable-exif --enable-calendar --with-bz2=/usr --with-mcrypt=/usr --with-gd --with-jpeg-dir=/usr --with-png-dir=/usr --with-zlib-dir=/usr --with-freetype-dir=/usr --enable-mbstring --enable-zip --with-pear --with-config-file-path=/etc/php5 --with-config-file-scan-dir=/etc/php5/conf.d
make
sudo make install
then,
install your php extensions ( apc, mcrypt, pdo, ... )
If unavailable, try:
sudo pecl install pdo
If you have to change your php.ini path, you can use Apache conf Directive :
PHPIniDir /etc/php5/apache2
but with the 'with-config-file-path=/etc/php5' configure option, it will search for /etc/php5/php.ini, so you only have to make a symbolic link between /etc/php5/php.ini /etc/php5/apache2/php.ini
