Skip to content

Instantly share code, notes, and snippets.

@erwaller
Created April 29, 2010 19:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save erwaller/384071 to your computer and use it in GitHub Desktop.
Save erwaller/384071 to your computer and use it in GitHub Desktop.
#! /bin/bash
# sudo apt-get install make bison flex gcc patch autoconf subversion locate
# sudo apt-get install libxml2-dev libbz2-dev libpcre3-dev libssl-dev zlib1g-dev libmcrypt-dev libmhash-dev libmhash2 libcurl4-openssl-dev libpq-dev libpq5 libsyck0-dev
# sudo apt-get install libmysqlclient15-dev
BASEDIR=$PWD
# LIBEVENT
echo "Downloading and building libevent..."
export LE_VER=1.4.12-stable
wget "http://www.monkey.org/~provos/libevent-$LE_VER.tar.gz"
tar -zxvf "libevent-$LE_VER.tar.gz"
cd "libevent-$LE_VER"
./configure && make
DESTDIR=$PWD make install
export LIBEVENT_SEARCH_PATH="$PWD/usr/local"
cd $BASEDIR
# PHP FPM
echo "Downloading and generating PHP FPM patch..."
export PHP_VER=5.3.0
wget "http://launchpad.net/php-fpm/master/0.6/+download/php-fpm-0.6~$PHP_VER.tar.gz"
tar -zxvf "php-fpm-0.6~$PHP_VER.tar.gz"
"php-fpm-0.6-$PHP_VER/generate-fpm-patch"
# PHP
echo "Downloading php..."
wget "http://us.php.net/get/php-$PHP_VER.tar.gz/from/us.php.net/mirror"
tar xvfz "php-$PHP_VER.tar.gz"
cd "php-$PHP_VER"
# APPLY PHP FM PATCH && BUILD PHP
echo "Applying FPM patch and building php..."
patch -p1 < ../fpm.patch
./buildconf --force
mkdir fpm-build && cd fpm-build
../configure --with-fpm --with-libevent="$LIBEVENT_SEARCH_PATH" --enable-fastcgi\
--with-mcrypt --with-zlib --enable-mbstring --with-mysql=/usr/include/mysql\
--with-curl --disable-debug --enable-pic --disable-rpath --enable-inline-optimization\
--with-bz2 --with-xml --with-zlib --enable-sockets --enable-sysvsem --enable-sysvshm\
--enable-pcntl --enable-mbregex --with-mhash --enable-xslt --enable-memcache --enable-zip\
--with-pcre-regex
make all
make install
# add to startup with `update-rc.d php-fpm defaults; invoke-rc.d php-fpm start`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment