PHP-FPM(8)

πŸ“¦
version 8.2.35 Β· 3 versions
, in debian bookworm

πŸ’– php-fpm β€” PHP FastCGI Process Manager πŸ’–

okay bestie, sit down, hydrate, because we're talking about php-fpm β€” the PHP FastCGI Process Manager, aka the thing running in the background making your whole web stack look cute. ✨

This is the PHP-FPM(8) page from the Scripting Language manual, and yes I'm gonna tell you literally everything on it. no skips. no cap.


✨ SYNOPSIS ✨

php-fpm [options]

that's it. that's the whole vibe. you feed it options, it goes off and does daemon things. πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

okay so PHP β€” you've heard of her β€” is a widely-used general-purpose scripting language that's especially suited for Web development, and she can get embedded right up into HTML. iconic behavior, we love her for that.

php-fpm is that same PHP, but the variant that runs in the background as a daemon, just vibing there, listening for CGI requests. Output gets logged to /var/log/php-fpm.log.

Most options? They're set in the config file, not on the command line. The config file lives at /etc/php-fpm.conf. By default, php-fpm responds to CGI requests listening on localhost http port 9000. So what that means for you, bestie, is that php-fpm expects your webserver to forward all requests for .php files to port 9000 β€” so go edit your webserver config file appropriately. yes, actually. do it. 🫢


πŸŽ€ OPTIONS πŸŽ€

here's the whole roster, no crumbs left behind:

  • -C β€” do not chdir to the script's directory 🚫
  • --php-ini path|file, -c path|file β€” go look for the php.ini file in the directory path, or just use the specified file directly πŸ”
  • --no-php-ini, -n β€” absolutely no php.ini file will be used. none. zero. nada. πŸ™ˆ
  • --define foo[=bar], -d foo[=bar] β€” define the INI entry foo with the value bar, as a lil treat ✨
  • -e β€” generate extended information for debugger/profiler πŸ•΅οΈ
  • --help, -h β€” the help. the assist. the "what do I even do here" button πŸ’–
  • --info, -i β€” PHP information and configuration, the whole lore dump πŸ“œ
  • --modules, -m β€” show compiled in modules πŸ‘‘
  • --version, -v β€” version number, obviously πŸ’…
  • --prefix path, -p β€” specify an alternative prefix path (the default is /usr) 🌸
  • --pid file, -g β€” specify where the PID file lives πŸ“
  • --fpm-config file, -y β€” specify an alternative path to the FastCGI process manager configuration file (the default is /etc/php-fpm.conf) ⭐
  • --test, -t β€” test the FPM configuration file and exit. and if you call it twice (-tt), the configuration is dumped before exiting πŸ‘€
  • --daemonize, -D β€” force it to run in the background and ignore the daemonize option from the configuration file πŸŒ™
  • --nodaemonize, -F β€” force it to stay in the 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 πŸ“’
  • --allow-to-run-as-root, -R β€” allow the pool to run as root (disabled by default) πŸ’€
real talk on that last one: -R is disabled by default for a reason. running as root is giving danger. don't just flip it on for funsies.

🌈 FILES 🌈

  • php-fpm.conf β€” the configuration file for the php-fpm daemon πŸŽ€
  • php.ini β€” the standard php configuration file πŸ“„

πŸ”₯ SIGNAL πŸ”₯

once she's started, php-fpm responds to several POSIX signals. here's the cheat sheet:

  • SIGINT, SIGTERM β€” immediate termination. bye, instantly. 😭
  • SIGQUIT β€” graceful stop. the polite exit. πŸšͺ
  • SIGUSR1 β€” re-open the log file πŸ“‚
  • SIGUSR2, SIGHUP β€” graceful reload of all workers + reload of fpm conf/binary πŸ”„

πŸ‘‘ SEE ALSO πŸ‘‘


πŸ’€ BUGS πŸ’€

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

(ngl, if you found a bug, go tell them. they wanna know. iykyk. πŸ›)


🫢 AUTHORS 🫢

the 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: http://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. no seriously, a huge amount. that's the whole world showing up. 🌍


🌸 VERSION INFORMATION 🌸

this manpage describes php-fpm, version 8.2.35. πŸ’…


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. πŸ“¬


and that's the whole page, bestie, you ate πŸŽ€πŸ’–

The PHP Group Β· 2024 Β· PHP-FPM(8) β€” mwah, talk later, go fix your webserver config πŸ¦‹βœ¨
πŸ“¦ where this page comes from