Mini howto to install PHP5 on Debian from source
Installation of PHP5, on Debian Sarge 3.1
apt-get install \
libxml2 \
libc-client-dev \
libgmp3-dev \
libgmp3-doc \
libmpfr-dev \
libpng2-dev \
libpng2 \
libjpeg62-dev \
libgdbmg1 \
libgdbm-dev \
libc6-dev \
libbz2-dev \
bzip2 \
zlib1g-dev \
zlib1g \
apache-dev \
g++ \
g++-2.95 \
gcc-2.95-doc \
stl-manual \
libc6-dev \
libstdc++2.10-dev \
make \
libdb1 \
libxml2-dev \
flex
‘./configure’ ‘–with-bz2’ ‘–with-gd’ ‘–with-mysql’ ‘–with-apxs=/usr/bin/apxs’ ‘–with-mod_charset’ ‘–enable-force-cgi-redirect’ ‘–enable-discard-path’ ‘–enable-safe-mode’ ‘–enable-bcmath’ ‘–enable-calendar’ ‘–with-gdbm’ ‘–enable-dbase’ ‘–enable-ftp’ ‘–enable-gd-imgstrttf’ ‘–with-gmp’ ‘–with-xml=shared’ ‘–enable-trans-sid’ ‘–enable-shmop’ ‘–enable-sockets’ ‘–with-regex=php’ ‘–enable-sysvsem’ ‘–enable-sysvshm’ ‘–enable-yp’ ‘–enable-memory-limit’ ‘–enable-shared’ ‘–with-zlib’ ‘–with-imap=usr/include/c-client’ ‘–prefix=/usr/local/php5’ ‘–with-jpeg-dir=/usr/lib/’ ‘–with-kerberos’ ‘–with-imap-ssl’
make && make install