Fast CGI (spawn-fcgi / php-cgi) crashes/dies/hangs

Michael Shadle mike503 at gmail.com
Wed Dec 9 07:47:34 MSK 2009


Perhaps in a little bit - however, I don't supervise php-fpm with anything.

If you're referencing something I said in the past about using
upstart, that was in combination directly with php -b $port

I had one file per pool

I think I've posted that somewhere on the net, I can't find it right
now. But I'm all about transparency (as long as it still retains
privacy)

Note I am using php 5.2.11 w/ the patch from php-fpm.org, my build
script for PHP is this, it works like a charm on CentOS 5.x x86_64,
Ubuntu various versions in 64-bit, and I think I even had it running
under 32-bit just had to remove a couple compile options.

This same pattern of compiling has been in place for many versions of
php 5.2.x, it also seems to work for 5.3.x but I have not tested that
in production yet because I don't think a lot of my clients' code will
work with 5.3.x - yes, I have to support a LOT of crappy code, and
millions of requests a day on it :)

I do want to share this in some sort of wiki-ish fashion. All my
little snippets of code and any changes I make to them and why. People
over-complicate nginx configurations for things all the time for
example.

Note: using this on a modern CentOS/RHEL/Fedora or Ubuntu system
should be stable.

#!/bin/bash
VER=5.2.11
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}

wget -c http://php-fpm.org/downloads/php-${VER}-fpm-0.5.13.diff.gz
gunzip php-${VER}-fpm-0.5.13.diff.gz
patch -p1 < php-${VER}-fpm-0.5.13.diff

wget -c http://download.suhosin.org/suhosin-patch-${VER}-0.9.7.patch.gz
gunzip suhosin-patch-${VER}-0.9.7.patch.gz
patch -p1 < suhosin-patch-${VER}-0.9.7.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-gettext \
--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 -j4
make install
cd $BD
rm -rf php-${VER} php-${VER}.tar.gz



On Tue, Dec 8, 2009 at 8:35 PM, nerdgrind <nginx-forum at nginx.us> wrote:
> Mike,
>
> On your website perhaps you could post all the configurations you use to run php-fpm, including the events file from Ubuntu you use to respawn php-fpm.
>
> Posted at Nginx Forum: http://forum.nginx.org/read.php?2,28783,29118#msg-29118
>
>
> _______________________________________________
> nginx mailing list
> nginx at nginx.org
> http://nginx.org/mailman/listinfo/nginx
>



More information about the nginx mailing list