wget http://www.boutell.com/gd/http/gd-2.0.33.tar.gz
wget http://ftp.gnome.org/pub/GNOME/sources/libxml2/2.6/libxml2-2.6.19.tar.gz
wget http://www.zlib.net/zlib-1.2.3.tar.gz
wget http://curl.haxx.se/download/curl-7.15.0.tar.gz
wget http://nchc.dl.sourceforge.net/sourceforge/libpng/libpng-1.2.8.tar.gz

gd  curl  libpng

./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache2/bin/apxs --with-png=/usr/local/lib/ --with-libxml-dir=/usr/local/libxml2 --with-mysql=/usr/local/mysql/ --libdir=/usr/lib/ --with-curl=/usr/local/curl/ --with-gd=/usr/local/gd/
make && make install

cp php.ini-dist /etc/php.ini

AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps