;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;; author: SlickStack ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;; link: https://slickstack.io ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;; mirror: https://mirrors.slickstack.io/modules/php-fpm/8.1/php-fpm-conf.txt ;;;;;;;;;;;;;;;;;;;; ;;;; path: n/a (boilerplate) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;; destination: /etc/php/8.1/fpm/php-fpm.conf (after install) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;; purpose: PHP-FPM configuration file boilerplate optimized for SlickStack servers ;;;;;;;;;;;;;; ;;;; module version: PHP-FPM 8.1.x ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;; sourced by: n/a ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;; bash aliases: n/a (ss-install-php-config) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; [global] ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;; PHP-FPM.conf: Global Options ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; hardcoding error log settings reduces potential conflicts and server resource usage ;; ;; take extreme caution when modifying any of below settings in your ss-config ;; pid = /run/php/php8.1-fpm.pid error_log = /var/www/logs/php-error.log syslog.facility = daemon syslog.ident = php-fpm log_level = error log_limit = 1024 ;; PHP 7.3+ log_buffering = yes ;; PHP 7.3+ emergency_restart_threshold = @FPM_EMERGENCY_RESTART_THRESHOLD ;; ss = 10 emergency_restart_interval = @FPM_EMERGENCY_RESTART_INTERVAL ;; ss = 1m process_control_timeout = @FPM_PROCESS_CONTROL_TIMEOUT ;; ss = 10s process.max = @FPM_PROCESS_MAX ;; ss = 128 process.priority = @FPM_PROCESS_PRIORITY ;; ss = -19 daemonize = yes ;; SlickStack does not use containers so we can daemonize rlimit_files = @FPM_RLIMIT_FILES ;; ss = 65535 rlimit_core = @FPM_RLIMIT_CORE ;; ss = 0 events.mechanism = epoll systemd_interval = @FPM_SYSTEMD_INTERVAL ;; ss = 10s ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;; PHP-FPM.conf: Pool Definitions ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; include=/etc/php/8.1/fpm/pool.d/*.conf ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;; SlickStack: External References Used To Improve This Script (Thanks, Interwebz) ;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Ref: https://github.com/php/php-src/blob/php-8.1.1/sapi/fpm/php-fpm.conf.in ;; Ref: https://www.php.net/manual/en/install.fpm.configuration.php ;; Ref: https://ma.ttias.be/a-better-way-to-run-php-fpm/ ;; Ref: https://serversforhackers.com/c/div-configuring-php-fpm ;; Ref: https://myjeeva.com/php-fpm-configuration-101.html ;; Ref: https://github.com/kerberos-io/web/issues/47 ;; Ref: https://serverfault.com/questions/917137/what-does-graceful-reload-actually-mean-with-php-fpm ;; Ref: https://selivan.github.io/2016/10/25/php-fpm-502-error-on-reload.html ;; Ref: https://github.com/voxpupuli/puppet-php/issues/395 ;; Ref: https://tkacz.pro/php-fpm-config-improvements/ ;; Ref: https://itresident.com/nginx/nginx-and-php-fpm-for-heavy-load-wordpress-web-server-with-high-traffic-2000-concurrent-connections/ ;; Ref: https://www.if-not-true-then-false.com/2011/nginx-and-php-fpm-configuration-and-optimizing-tips-and-tricks/ ;; Ref: https://bbs.archlinux.org/viewtopic.php?id=190202 ;; Ref: https://geekflare.com/php-fpm-optimization/ ;; Ref: https://git.autistici.org/ai3/docker/roundcube/commit/bad4e15ea7b12a22403f0bb8f677fbaafe9d43d2 ;; Ref: https://radwebhosting.com/client_area/knowledgebase/110/PHP-FPM-Configurable-Options.html ;; Ref: https://news.ycombinator.com/item?id=7951457 ;; Ref: https://community.centminmod.com/threads/centos-7-proper-php-fpm-systemd-service-file.16511/ ;; Ref: https://git.lug.ustc.edu.cn/vanabel/php-sandbox/commit/886cf1a3185919096b8fb6a9abfeb5ff9f13281e ;; Ref: https://www.digitalocean.com/community/questions/optimizing-php7-with-nginx ;; Ref: https://forum.nginx.org/read.php?3,235515 ;; Ref: https://serverfault.com/questions/939436/understand-correctly-pm-max-children-tuning ;; Ref: https://www.soughttech.com/front/article/3452/viewArticle ;; Ref: https://serverfault.com/questions/575451/nginx-php-fpm-each-php-fpm-process-70-100-cpu-when-running ;; Ref: https://discourse.roots.io/t/is-the-restart-of-php-fpm-on-each-deploy-necessary/21672 ;; SS_EOF