nginx

PHP Installation
Configure PHP:

./configure \
--with-config-file-path=/usr/local/etc/ \
--enable-fpm \
--enable-pdo \
--enable-mbstring \
--with-gd \
--with-curl \
--with-jpeg-dir \
--with-bz2 \
--with-zlib \
--with-pdo-mysql=/usr/local/mysql

Build and install:

make
make install

Copy the default configuration files:

cp php.ini-development /usr/local/etc/php.ini
cp /usr/local/etc/php-fpm.conf.default /usr/local/etc/php-fpm.conf

Edit /usr/local/etc/php-fpm.conf to make it run in the foreground and log messages:

daemonize = no
error_log = /dev/stderr

Daemontools startup
Assuming you have already installed daemontools., create the directories to hold the lighttpd run and logging scripts:

mkdir -p /var/service
cd /var/service
mkdir -m 1755 php-fpm
cd php-fpm

Create the run script (/var/service/php-fpm/run), with the following:

#! /bin/sh
exec 2>&1
exec /usr/local/sbin/php-fpm -F

Once you have saved the file, change it's permissions to it can be executed:

chmod 700 run

Create the logging service:

mkdir -m 755 log
cd log
wget http://qmail.jms1.net/scripts/run.log
mv run.log run
chmod 700 run

Create the symbolic link to start the php-fpm service

ln -s /var/service/php-fpm /service/php-fpm

nginx Configuration
Edit /usr/local/nginx/conf/nginx.conf and enable Fast-CGI by uncommenting and editing:

        location ~ \.php$ {
            root           html;
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_index  index.php;
            fastcgi_param  SCRIPT_FILENAME  $document_root/$fastcgi_script_name;
            include        fastcgi_params;
        }

Recent Updates

  • 5 days 7 min ago
    1.27.2 update
  • 2 weeks 2 days ago
    Drupal 10/11 config
  • 2 weeks 3 days ago
  • PHP
    2 weeks 3 days ago
    PHP 8.3.11 and AlmaLinux
  • 2 weeks 4 days ago
    New version of Pound