環境
- OS(userland): NetBSD 5.1
- kernel: NetBSD 5.99.41
- httpd: nginx 0.8.53
- PHP: 5.3.5
準備
libpng.soがないと文句を言われるので以下のようにして対処しておきます
# cd /usr/pkg/lib
# ln -s libpng15.so libpng.so
インストール
% ./configure --prefix=/usr/local/php \
 --with-libxml-dir=/usr/pkg \
 --with-mysql=/usr/pkg \
 --with-xmlrpc \
 --with-openssl \
 --with-jpeg-dir=/usr/pkg \
 --with-png-dir=/usr/pkg \
 --with-zlib \
 --enable-mbstring \
 --with-bz2 \
 --with-gd \
 --with-freetype-dir=/usr/X11R7 \
 --with-xpm-dir=/usr/X11R7 \
 --enable-gd-native-ttf \
 --enable-fpm \
 --with-mcrypt=/usr/pkg
% make
% su
# make install
設定
nginxで使えるように
/etc/rc.confに
php_fpm=YES
を追加
/etc/rc.d/php_fpm
#!/bin/sh
#
# $NetBSD: nginx.sh,v 1.2 2010/01/23 16:32:11 joerg Exp $
#
# PROVIDE: nginx
# REQUIRE: DAEMON
. /etc/rc.subr
name="php_fpm"
rcvar=${name}
command="/usr/local/php/sbin/php-fpm"
required_files="/usr/local/php/etc/php-fpm.conf"
pidfile="/var/run/php-fpm.pid"
#start_precmd="ulimit -n 2048"
#extra_commands="reload"
load_rc_config $name
run_rc_command "$1"