#download the source
curl -L -o /tmp/php.tar.gz http://www.php.net/get/php-5.2.5.tar.gz/from/this/mirror

#uncompress the file
cd /tmp
tar xvzf php.tar.gz

#configure, make and make install
cd /tmp/php-5.2.5
./configure --prefix=/usr/local/php-5.2.5 --with-apxs2=/usr/local/httpd/bin/apxs --with-mysql=/usr/local/mysql
make
sudo make install

#create a link
cd /usr/local
sudo ln -s php-5.2.5 php

#cleanup
rm -fr /tmp/php*
