Installing PHP-FPM on CentOS Stream, Fedora, or Red Hat Enterprise Linux (RHEL) adds a dedicated FastCGI manager for PHP requests instead of running application code inside the web-server process. That packaged layout is the normal path for Nginx and for Apache hosts that proxy dynamic requests through proxy_fcgi.
The distro package is php-fpm. It installs the main PHP-FPM configuration in
/etc/php-fpm.conf
, keeps pool files in
/etc/php-fpm.d/
, and exposes the unversioned php-fpm.service unit. The packaged www pool listens on
/run/php-fpm/www.sock
, which is the default socket path most current Apache and Nginx examples expect.
The main branch decision point is RHEL 9. Current Fedora, CentOS Stream 10, and RHEL 10 releases expose PHP-FPM directly through dnf install php-fpm, while RHEL 9 still keeps newer supported PHP branches behind php module streams even though the default package path remains available. Minimal containers and chroots can install the package without a runnable systemd service, so do the final enable, start, and socket checks on a normal host.
Related: Install the base PHP runtime
Related: Create an additional PHP-FPM pool
Steps to install PHP-FPM on CentOS, Fedora, or Red Hat:
- Check which PHP-FPM package branch the enabled repositories currently expose.
$ sudo dnf info php-fpm Available Packages Name : php-fpm Version : 8.3.29 Release : 1.el10 Architecture : x86_64 Repository : appstream Summary : PHP FastCGI Process Manager
The exact version depends on the distro release and enabled repositories. Current Fedora 42 package metadata exposes an 8.4.x build, current CentOS Stream 10 and RHEL 10.1 package sets expose 8.3.29, and the default RHEL 9.7 path still exposes 8.0.30.
If dnf info php-fpm reports no matching package on RHEL, confirm that the normal AppStream or UBI repositories are reachable before continuing.
- List the optional PHP module streams on RHEL 9 before changing away from the default branch.
$ sudo dnf module list php Red Hat Universal Base Image 9 (RPMs) - AppStream Name Stream Profiles Summary php 8.1 common, devel, minimal PHP scripting language php 8.2 common, devel, minimal PHP scripting language php 8.3 common, devel, minimal PHP scripting language
Skip this step on Fedora, CentOS Stream 10, or RHEL 10. On RHEL 9, the common profile includes php-fpm for web-serving workloads, while minimal omits it.
RHEL 10 ships PHP 8.3 as non-modular packages, so there is no php application stream to select there.
- Install the distro-packaged PHP-FPM service.
$ sudo dnf install --assumeyes php-fpm
Current Fedora, CentOS Stream 10, and RHEL 10 use this direct path. On RHEL 9, the same command installs the default 8.0 package set.
When a clean RHEL 9 host needs a newer supported branch with PHP-FPM included, install the matching common profile instead, for example sudo dnf module install --assumeyes php:8.3/common.
- Verify the installed package, packaged paths, and default listener.
$ rpm -q php-fpm php-fpm-8.3.29-1.el10.x86_64 $ rpm -ql php-fpm | grep -E '/etc/php-fpm.conf|/etc/php-fpm.d/www.conf|php-fpm.service$' /etc/php-fpm.conf /etc/php-fpm.d/www.conf /usr/lib/systemd/system/php-fpm.service $ grep -E '^[;[:space:]]*listen[[:space:]]*=' /etc/php-fpm.d/www.conf listen = /run/php-fpm/www.sock
The exact package string changes with the distro branch and update level, but current Red Hat family packages keep the same main config path, pool path, and unversioned php-fpm.service unit.
The socket file itself does not exist until the service starts and systemd creates the runtime directory for php-fpm.
Related: Find PHP configuration files
- Enable and start the PHP-FPM service.
$ sudo systemctl enable --now php-fpm
The unit name is unversioned on current Fedora, CentOS Stream, and RHEL packages, so later service commands use php-fpm rather than a versioned unit name.
Container and chroot installs often lack a running systemd instance, so perform this step on the actual host that will serve the PHP workload.
Related: Manage the PHP-FPM service
- Confirm that the service is enabled, active, and exposing the default socket.
$ sudo systemctl is-enabled php-fpm enabled $ sudo systemctl is-active php-fpm active $ sudo test -S /run/php-fpm/www.sock && echo socket-ready socket-ready
If the socket check fails, confirm the listen path in
/etc/php-fpm.d/www.conf
and inspect the unit logs with sudo journalctl --unit=php-fpm --no-pager --lines=50 before changing the web-server configuration.
Related: Manage the PHP-FPM service
Mohd Shakir Zakaria is a cloud architect with deep roots in software development and open-source advocacy. Certified in AWS, Red Hat, VMware, ITIL, and Linux, he specializes in designing and managing robust cloud and on-premises infrastructures.
