nabeel shahzad

Building php-fpm against Ubuntu PHP Packages

without comments

This is how I’ve been building php-fpm against the Debian PHP packages. It’ll be useful for when Ubuntu 10.04 (Lucid Lynx) Comes out with PHP 5.3. I do this from my home directory. It will download the package souce from Ubuntu, then compile php-fpm standalone against that.

Shell
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
sudo apt-get install php5-cli php5-cgi php5-common \
php5-curl php5-dev php5-gd php5-mcrypt \
php5-memcache php5-mysql php5-suhosin
# Get from the Debian repo
sudo apt-get build-dep php5-common
sudo apt-get -b source php5-common
# Change this to the PHP version being used!
# Look on http://launchpad.net/php-fpm/master to match it
export PHP_VER=5.2.10
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"
cd "php-fpm-0.6-$PHP_VER"
mkdir fpm-build && cd fpm-build
sudo ../configure --srcdir=../ \
--with-php-src="../../php5-5.2.10.dfsg.1" \
--with-php-build="../../php5-5.2.10.dfsg.1/cgi-build" \
--with-fpm-conf="/etc/php5/fpm/php-fpm.conf" \
--with-libevent="/usr/lib"
sudo make
sudo make install
sudo update-rc.d php-fpm defaults
# Resulting in:
Installing PHP FPM binary: /usr/local/bin/php-fpm
Installing PHP FPM config: /etc/php5/fpm/php-fpm.conf
Installing PHP FPM man page: /usr/local/man/man1/php-fpm.1
Installing PHP FPM init script: /etc/init.d/php-fpm
*** FPM Installation complete. ***
run:
`update-rc.d php-fpm defaults; invoke-rc.d php-fpm start`

Then, configure the php-fpm file. That should be it :)

Written by Nabeel

April 4th, 2010 at 10:54 am

Posted in General