PortGate

Blueprints · Laravel & PHP

Production 20 min · Linux

Separate PHP-FPM pool

Stages a pool that runs as its own user and listens on a socket. It does not reload PHP.

Live config

Baked-in protections

Step 1 · ini

Pool file

/root/portgate-blueprints/app.conf

Create the user before you enable the pool. Copy the file into /etc/php/*/fpm/pool.d/.

[app]
user = app
group = app
listen = /run/php/app.sock
listen.owner = www-data
listen.group = www-data
pm = ondemand
pm.max_children = 8
php_admin_value[open_basedir] = /var/www/app:/tmp

Step 2 · bash

Read-only check

/root/portgate-blueprints/pool-check.sh

Prints status. It does not change the service.

#!/bin/sh
set -eu
ls /run/php 2>/dev/null || echo "No PHP sockets under /run/php yet."