PHP-FPM(8)
π php-fpm β the PHP-FPM manual, but make it make sense
okay so bestie, this is the page for php-fpm, aka the PHP FastCGI Process Manager (they literally call it 'PHP-FPM', quotes and all, iconic). come sit, we're learning this together π«Ά
β¨ SYNOPSIS β¨
php-fpm [options]
that's it. that's the whole summoning ritual π
πΈ 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 knew that. we all knew that. but this variant β this one right here β runs in the background as a daemon, just sitting there listening for CGI requests like a loyal little guard dog π. its output gets logged to /var/log/php-fpm.log.
most options? not set here, babes. they live in the configuration file, and that file is /etc/php85/php-fpm.conf. by default, php-fpm responds to CGI requests listening on localhost http port 9000. so basically it expects your webserver to forward all requests for .php files to port 9000, and you should edit your webserver configuration file appropriately. no cap, that part's on you π
π OPTIONS π
one bullet per flag, let's go, no skipping, we're eating this whole menu π
-Cβ do not chdir to the script's directory. just don't. stay put.--php-ini path|file,-c path|fileβ look for thephp.inifile in the directory path, or just use the specified file. your call, main character π--no-php-ini,-nβ nophp.inifile will be used. none. zero. empty. the void. π--define foo[=bar],-d foo[=bar]β define INI entryfoowith valuebar.-eβ generate extended information for debugger/profiler. detective mode π--help,-hβ this help. hi, this is the help. you're looking at it.--info,-iβ PHP information and configuration.--modules,-mβ show compiled in modules. show me what you're made of β¨--version,-vβ version number.--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/php85/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. double-tap for the tea β--daemonize,-Dβ force it to run in the background and ignore thedaemonizeoption from the configuration file.--nodaemonize,-Fβ force it to stay in the foreground and ignore thedaemonizeoption from the configuration file.--force-stderr,-Oβ force output tostderrinnodaemonizeeven ifstderris not a TTY.--allow-to-run-as-root,-Rβ allow pool to run as root (disabled by default). scary. powerful. use responsibly π
π¦ FILES π¦
php-fpm.confβ the configuration file for thephp-fpmdaemon.php.iniβ the standard php configuration file.
π EXAMPLES π
okay so if you're on a unix system that uses init.d as its main process manager, you should use the init script provided to start and stop the php-fpm daemon. like this:
sudo /etc/init.d/php-fpm start
and if your unix system uses systemd as its main process manager, you should use the unit file provided to start and stop the php-fpm daemon. like this:
sudo systemctl start php-fpm.service
now. if your installation has no appropriate init script (it happens, don't panic), just launch php-fpm with no arguments. it'll launch as a daemon (background process) by default, because it's an independent queen π
the file /var/run/php-fpm.pid determines whether php-fpm is already up and running. and once it's started, php-fpm 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
heads up bestie:SIGINT/SIGTERMis the immediate termination vibe β no soft launch, no goodbye.SIGQUITis the graceful stop if you're feeling polite. choose accordingly π
π TIPS π
the PHP-FPM CGI daemon will work well with most popular webservers, including Apache2, lighttpd and nginx. it's giving "gets along with everyone" energy, we love a social butterfly π¦
β 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 β go snitch, it's encouraged π«Ά
π 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. absolute legends, every single one π
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. fr fr, global effort, we stan ππ
π§ VERSION INFORMATION π§
this manpage describes php-fpm, version 8.5.12.
π COPYRIGHT π
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. helpful and prompt, we love to see it π
and that's the whole page, bestie π brought to you by The PHP Group, dated 2024, filed under PHP-FPM(8) β now go forth and daemonize responsibly π β¨
π¦ where this page comes from
- alpine 3.24: php85-doc 8.5.12-r0 Β· PHP-3.01 BSD-3-Clause LGPL-2.0-or-later MIT Zend-2.0 Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms