#!/bin/bash
VER=5.2.8
BD=`pwd`
rm -rf php-${VER}
wget -c http://us3.php.net/get/php-${VER}.tar.gz/from/this/mirror
tar xvfz php-${VER}.tar.gz
cd php-${VER}
# php-fpm
wget -c http://php-fpm.anight.org/downloads/head/php-${VER}-fpm-0.5.10.diff.gz
gunzip php-${VER}-fpm-0.5.10.diff.gz
patch -p1 < php-${VER}-fpm-0.5.10.diff
# suhosin
wget -c http://download.suhosin.org/suhosin-patch-${VER}-0.9.6.3.patch.gz
gunzip suhosin-patch-${VER}-0.9.6.3.patch.gz
patch -p1 < suhosin-patch-${VER}-0.9.6.3.patch
./configure \
--enable-fastcgi \
--enable-discard-path \
--enable-force-cgi-redirect \
--enable-fpm \
--with-fpm-pid=/var/run/php-fpm.pid \
--with-fpm-log=/var/log/php-fpm.log \
--with-fpm-conf=/etc/php-fpm.conf \
--enable-cli \
--enable-inline-optimization \
--disable-rpath \
--disable-ipv6 \
--enable-mbstring \
--enable-mbregex \
--enable-sqlite-utf8 \
--with-mysql \
--with-mysqli=/usr/bin/mysql_config \
--with-curl \
--with-zlib \
--with-gd \
--with-jpeg-dir=/usr \
--with-png-dir=/usr \
--with-freetype-dir \
--enable-gd-native-ttf \
--enable-exif \
--enable-shmop \
--with-xsl=shared \
--with-mssql=shared \
--enable-soap=shared \
--enable-sockets \
--enable-pcntl=shared \
--with-mcrypt \
--with-bz2 \
--with-tidy \
--with-pcre-dir \
--with-openssl \
--with-imap=shared \
--with-imap-ssl \
--with-kerberos \
--with-pear \
--with-gmp
make -j2
checkinstall --pkgname="php" --pkgversion=$VER
--maintainer="webm...@foo.com" --provides="php5-cgi, php5-cli,
php5-common, php5, php" --strip=yes --stripso=yes --backup=no -y
mv *.deb ..
cd $BD
rm -rf php-${VER} php-${VER}.tar.gz
below is my ppa, you can find the php5-5.2.8 package with php-fpm and
suhosin patch(and many others)
https://launchpad.net/~tarkus/+archive
deb http://ppa.launchpad.net/tarkus/ubuntu hardy main deb-src http://ppa.launchpad.net/tarkus/ubuntu hardy mainor directly download them from https://launchpad.net/~tarkus/+archive