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

Read more

Linux Slackware + Apache2 + PHP + mod_fastcgi

This tutorial assumes that you are already familiar with Slackware Linux and Apache2.

Before you start, make sure you have a working httpd.conf of Apache2 because a detailed configuration is not included in this tutorial. Then, remove the installed packages of Apache2 and PHP using Slackware’s pkgtool.

Go to Apache website and get the latest version of Apache2. In this tutorial I’m using Apache-2.2.9:

cd /usr/local/src
wget http://www.eu.apache.org/dist/httpd/httpd-2.2.9.tar.gz

Go to PHP website and get the latest version of PHP5. In this tutorial I’m using PHP-5.2.6

wget http://www.php.net/get/php-5.2.6.tar.gz/from/de.php.net/mirror

Read more