PHP-FPM(8)

πŸ’… PHP-FPM(8) β€” the php-fpm girlies' guide

okay so bestie, you're looking at the manual page for php-fpm in section 8, and honestly? it's giving main character energy. let's get into it 🌸


✨ NAME ✨

php-fpm β€” the PHP FastCGI Process Manager, aka 'PHP-FPM' πŸ’– (yes that's its whole government name, quotes and all)


πŸŽ€ SYNOPSIS πŸŽ€

php-fpm [options]

that's it. that's the whole vibe. options go in, daemon comes out ✨


πŸ¦‹ DESCRIPTION πŸ¦‹

so. PHP is a widely-used general-purpose scripting language that's especially suited for Web development and can be embedded into HTML β€” you already knew that, you're an icon πŸ’…

This particular variant of PHP is the one that runs in the background as a daemon, lowkey just sitting there listening for CGI requests. and where does its output go, you ask? it's logged to /var/log/php-fpm.log πŸ“

most options are set in the configuration file β€” which is /etc/php/php-fpm.conf, no cap. by default, php-fpm responds to CGI requests listening on localhost http port 9000. so what that means for you is: php-fpm expects your webserver to forward all requests for '.php' files to port 9000, and you should edit your webserver configuration file appropriately. yes, you. go do it. 🫢


🌈 OPTIONS 🌈

  • -C β€” do not chdir to the script's directory. stay put, queen.
  • --php-ini path|file, -c path|file β€” look for the php.ini file in the directory path, or just use the specified file.
  • --no-php-ini, -n β€” no php.ini file will be used. none. zero. ghosted. πŸ’€
  • --define foo[=bar], -d foo[=bar] β€” define INI entry foo with value bar. cute little inline override ✨
  • -e β€” generate extended information for debugger/profiler. detective mode πŸ”
  • --help, -h β€” this help. hi bestie πŸ‘‹
  • --info, -i β€” PHP information and configuration. the full tea β˜•
  • --modules, -m β€” show compiled in modules. look at all her little friends 🧚
  • --version, -v β€” version number. who is she πŸ‘‘
  • --prefix path, -p β€” specify alternative prefix path (the default is /usr).
  • --pid file, -g β€” specify the PID file location.
  • --fpm-config file, -y β€” specify alternative path to the FastCGI process manager configuration file (the default is /etc/php/php-fpm.conf).
  • --test, -t β€” test the FPM configuration file and exit. and listen β€” if you call it twice (-tt), the configuration is dumped before exiting. double tap for the receipts πŸ“
  • --daemonize, -D β€” force it to run in background and ignore the daemonize option from the configuration file. she said "config, who?"
  • --nodaemonize, -F β€” force it to stay in foreground and ignore the daemonize option from the configuration file.
  • --force-stderr, -O β€” force output to stderr in nodaemonize even if stderr is not a TTY. ngl kind of a niche one but ok πŸ”₯
  • --allow-to-run-as-root, -R β€” allow pool to run as root (disabled by default). ⚠️ yeah she's off by default for a reason, be careful with this one fr fr.

🌸 FILES 🌸

  • php-fpm.conf β€” the configuration file for the php-fpm daemon. her whole personality lives here.
  • php.ini β€” the standard php configuration file.

πŸ’œ EXAMPLES πŸ’œ

okay so depending on what your unix system uses to manage processes, you've got options:

for any unix systems which use init.d for their main process manager, you should use the init script provided to start and stop the php-fpm daemon:

sudo /etc/init.d/php-fpm start

for any unix systems which use systemd for their main process manager, you should use the unit file provided to start and stop the php-fpm daemon:

sudo systemctl start php-fpm.service

and if your installation has no appropriate init script? no worries bestie. just launch php-fpm with no arguments. it'll launch as a daemon (background process) by default β€” icon behaviour. the file /var/run/php-fpm.pid determines whether php-fpm is already up and running πŸ‘€

once started, php-fpm then responds to several POSIX signals:

SIGINT,SIGTERM      immediate termination
SIGQUIT             graceful stop
SIGUSR1             re-open log file
SIGUSR2             graceful reload of all workers + reload of
fpm conf/binary

⭐ TIPS ⭐

the PHP-FPM CGI daemon will work well with most popular webservers, including Apache2, lighttpd and nginx. she's friendly like that 🫢


πŸ‘‘ SEE ALSO πŸ‘‘

for a more or less complete description of PHP-FPM, look here: https://www.php.net/fpm


πŸ’€ BUGS πŸ’€

you can view the list of known bugs or report any new bug you found at: https://github.com/php/php-src/issues

(be nice in the issue tracker pls πŸ™ˆ)


🧚 AUTHORS 🧚

PHP-FPM SAPI was written by Andrei Nigmatulin. the mailing-lists are highload-php-en (English) and highload-php-ru (Russian).

The PHP Group: Thies C. Arntzen, Stig Bakken, Andi Gutmans, Rasmus Lerdorf, Sam Ruby, Sascha Schumann, Zeev Suraski, Jim Winstead, Andrei Zmievski.

a list of active developers can be found here: https://www.php.net/credits.php

and last but not least, PHP was developed with the help of a huge amount of contributors all around the world. literally the whole group chat showed up πŸŒπŸ’–


πŸ”₯ VERSION INFORMATION πŸ”₯

this manpage describes php-fpm, version 8.5.12.


Copyright Β© The PHP Group Copyright (c) 2007-2009, Andrei Nigmatulin

this source file is subject to version 3.01 of the PHP license, that is bundled with this package in the file LICENSE, and is available through the world-wide-web at the following url: https://www.php.net/license/3_01.txt

if you did not receive a copy of the PHP license and are unable to obtain it through the world-wide-web, please send a note to license@php.net so we can mail you a copy immediately.


okay that's the whole page bestie, you ate that πŸ’…βœ¨

πŸŒˆπŸ’– brought to you by The PHP Group, dated 2024, living in PHP-FPM(8) β€” slay, periodt. πŸŽ€
πŸ“¦ where this page comes from