Install necessary software by yum or from source
yum install gd gd-devel yum install zlib zlib-devel
then
a) Download the php source from here : http://www.php.net/downloads.php
b) Download the source file in to /tmp directory
c) Here I am gussing the php version is php-5.3.0.tar.gz
d) Tar –xvzf php-5.3.0.tar.gz
e) Cd php-5.3.0
f)
./configure –with-apxs2=/usr/local/apache/bin/apxs –with-mysql=/usr/local/mysql –enable-mbstring –-with-gd –-with-zlib –-with-jpeg-dir –-with-png-dir
g) make
h) make install
i) setup your [...]