Introducing Kabballa: PHP-FPM for UNA Applications Deployment

Kabballa is a modern platform for managing and deploying scalable infrastructures, supporting technologies like MySQL, Redis, Nginx, PHP, Golang, Node.js, Memcached, Elasticsearch, and more. It leverages Kubernetes or Docker Swarm for orchestration and will soon be open source.

Features:

  • PHP-FPM installation and configuration.
  • Dynamic PHP settings using .env files.
  • Support for Memcached and Imagick extensions.
  • Predefined PHP, Opcache, and PHP-FPM settings.
  • Compatibility with multiple PHP versions (7.4, 8.0, 8.1, 8.2).
  • .ENV file for custom settings

Quick Install with `curl

You can install UNA PHP with Kabballa lib setup directly, without cloning the repo:

For the `dev` branch with latest optimization:

curl -sSL -o php.sh https://raw.githubusercontent.com/kabballa/PHP-UNA/dev/php.sh
chmod +x php.sh
./php.sh

For the `1.0.0` branch:

curl -sSL -o php.sh https://raw.githubusercontent.com/kabballa/PHP-UNA/1.0.0/php.sh
chmod +x php.sh
./php.sh

Follow the on-screen prompts to complete the installation.

Customizing PHP Settings

To customize memory limits or upload sizes, copy `.env.example` to `.env` and edit as needed, for example:

# ----------------------------------------------------------------------------------#
#                                                                                   #
#   Copyright (C) 2009 - 2025 Coozila! Licensed under the MIT License.              #
#   Coozila! Team    lab@coozila.com                                                #
#                                                                                   #
# ----------------------------------------------------------------------------------#

# ----------------------------------------------------------------------------------#

#  PHP.INI SETTINGS  ---------------------------------------------------------------#

# Maximum amount of memory a script may consume.
MEMORY_LIMIT=32768M

# Maximum size of POST data that PHP will accept.
POST_MAX_SIZE=4096M

# Maximum allowed size for uploaded files.
UPLOAD_MAX_FILESIZE=4096M

# Default timezone for date and time functions.
DATE_TIMEZONE=Europe/London

# Allow the use of PHP short open tags ().
SHORT_OPEN_TAG=On

# Enable the ability to open files via URL.
ALLOW_URL_FOPEN=On

# Allow the inclusion of files via URL.
ALLOW_URL_INCLUDE=Off

# Comma-separated list of functions to disable for security.
DISABLE_FUNCTIONS=

# ----------------------------------------------------------------------------------#

#  OPCACHE SETTINGS  -------------------------------------------------------------#

# Enable or disable the Opcache extension.
OPCACHE_ENABLE=1

# Frequency (in seconds) to check for script updates.
OPCACHE_REVALIDATE_FREQ=0

# Validate timestamps to check for script updates.
OPCACHE_VALIDATE_TIMESTAMPS=1

# Maximum number of files to cache.
OPCACHE_MAX_ACCELERATED_FILES=200000

# Amount of memory allocated to Opcache.
OPCACHE_MEMORY_CONSUMPTION=256

# Maximum percentage of wasted memory before a restart.
OPCACHE_MAX_WASTED_PERCENTAGE=20

# Amount of memory for interned strings.
OPCACHE_INTERNED_STRINGS_BUFFER=16

# Enable fast shutdown for Opcache.
OPCACHE_FAST_SHUTDOWN=1

# ----------------------------------------------------------------------------------#

#  MEMCACHED SETTINGS  -------------------------------------------------------------#

# Serializer to use for Memcached.
MEMCACHED_SERIALIZER=php

# Prefix for Memcached session keys.
MEMCACHED_SESS_PREFIX=memc.sess.key.

# Enable binary protocol for Memcached sessions.
MEMCACHED_SESS_BINARY=On

# Enable SASL authentication for Memcached.
MEMCACHED_USE_SASL=0

# Minimum wait time (in milliseconds) for session locks.
MEMCACHED_SESS_LOCK_WAIT_MIN=150

# Maximum wait time (in milliseconds) for session locks.
MEMCACHED_SESS_LOCK_WAIT_MAX=150

# ----------------------------------------------------------------------------------#

#  PHP-FPM SETTINGS  ---------------------------------------------------------------#

# Process manager type for PHP-FPM (dynamic, static, ondemand).
PM=dynamic

# Maximum number of child processes.
PM_MAX_CHILDREN=128

# Number of child processes created on startup.
PM_START_SERVERS=12

# Minimum number of idle child processes.
PM_MIN_SPARE_SERVERS=6

# Maximum number of idle child processes.
PM_MAX_SPARE_SERVERS=24

# Maximum number of requests a child process can handle before respawning.
PM_MAX_REQUESTS=0

# Permissions for the PHP-FPM socket.
LISTEN_MODE=0660

# Owner of the PHP-FPM socket.
LISTEN_OWNER=www-data

# Group of the PHP-FPM socket.
LISTEN_GROUP=www-data

# Maximum number of open files for PHP-FPM.
RLIMIT_FILES=65536

# Maximum size of core files created by PHP-FPM.
RLIMIT_CORE=0

# ----------------------------------------------------------------------------------#

Then re-run the script to apply your changes.

Tip:

Always copy commands and code directly from the git repo: https://github.com/kabballa/PHP-UNA to avoid formatting issues.

Thank you for using Kabballa! For feedback or suggestions, open an issue or pull request on GitHub.
  • 428
  • More
Replies (0)
Login or Join to comment.