1) download first php source code from php.net website
2) /home/flo/php-5.6.18
3) ./configure --prefix=/usr/local/php5 \
--enable-sigchild \
--enable-bcmath \
--with-jpeg-dir=/usr/lib64/ \
--with-png-dir=/usr/lib64/ \
--with-libdir=lib64 \
--with-apxs2=/usr/sbin/apxs \
--bindir=/usr/bin \
--sbindir=/usr/sbin \
--sysconfdir=/etc \
--with-openssl \
--includedir=/usr/include \
--libexecdir=/usr/libexec \
--localstatedir=/var \
--disable-rpath \
--with-config-file-path=/etc \
--with-config-file-scan-dir=/etc/php.d \
--with-exec-dir=/usr/bin \
--enable-dba \
--with-gettext \
--enable-exif \
--with-gettext \
--with-mhash \
--enable-magic-quotes \
--enable-sockets \
--with-mysql \
--with-mysql-sock \
--with-bz2 \
--enable-zip \
--enable-bcmath \
--with-zlib \
--with-openssl \
--enable-calendar \
--enable-mbstring \
--with-mcrypt \
--with-gd \
--with-pgsql \
--enable-xml
some of the modules or libraries from aboce in binary form could be missing in your environment, one can search for them if you are on CentOS via yum search httpd mysql postgresaql. Some of them may no longer exist as well, so comment them out if it doesnt configure properly. I guess compile has a special benefit of using only those pacakges that is solely required rather than having everything but it has limitations.
4) /home/flo/php-5.6.18> make

5) /home/flo/php-5.6.18> make test

6) /home/flo/php-5.6.18> sudo make install

i forgot what this was: Remembered to clear the /etc/php.d dir of all the ini files or move them to some other location first before compiling