Linux Slackware 13.0 + Nginx + PHP FastCGI using PHP-FPM
While Apache is a great web server, it has a high memory footprint. If you don’t need all the Apache features or if you have a slow/old/low memory machine Nginx (Engine X) might be perfect.
The typical nginx configuration involves using spawn-fcgi from the LightTPD project to get nginx serving up PHP. There are a few issues with spawn-fcgi which I’m not going to cover here.
In order to avoid these issues I’m going to use PHP-FPM. PHP-FPM stands for PHP FastCGI Process Manager. It is actually a set of patches for the PHP source that bake in FastCGI process management into the PHP binaries.
PHP-FPM requires libevent to be installed. Since Slackware doesn’t include a libevent package it has to be build from sources. In this tutorial I’m using libevent-1.4.12. An attached slackware package of libevent-1.4.12 is available at the end of this post.
cd /usr/local/src
wget http://www.monkey.org/~provos/libevent-1.4.12-stable.tar.gz
tar -xzvf libevent-1.4.12-stable.tar.gz
./configure --prefix=/usr
make
make install