Port 9000 (PHP-FPM)
Key facts
- Port
- 9000
- Protocols
- TCP
- Range
- Registered port, 1024-49151
- IANA service name
- cslistener
- Unofficial use
- The use described on this page is not the IANA assignment for this port. Source (opens in a new tab) Checked on 30.11.2026
IANA assigns ports in this range to services on request, under RFC 6335.
About port 9000
Port 9000 is best known as the port where PHP-FPM, the process manager that runs PHP for the web server, receives FastCGI requests. It runs over TCP. This is unofficial use: in the IANA registry, port 9000 is registered for the cslistener service.
The sample configuration file that ships with PHP sets PHP-FPM to listen on 127.0.0.1 and port 9000, and the PHP installation guide for Nginx passes requests to the same address.
What port 9000 is used for
- Web server and PHP-FPM on the same server: the web server receives the request and passes requests for PHP files to PHP-FPM at 127.0.0.1:9000, for example with the
fastcgi_pass 127.0.0.1:9000;setting in Nginx. - Containers: in Docker setups, a PHP-FPM container listens on port 9000, and the web server container connects to it over the containers' internal network.
- Several versions or pools: each PHP-FPM pool listens on its own address, for example on ports 9000, 9001, and so on, or on a separate Unix socket.
Other software sometimes uses port 9000 too, so when you check a server, confirm which process is actually listening on it.
Port 9000 in the firewall
Don't open PHP-FPM's port 9000 to the internet. When the web server and PHP-FPM are on the same server, PHP-FPM should listen only on 127.0.0.1, or on a Unix socket, which is the choice the PHP documentation recommends.
When PHP-FPM runs on a separate server, open the port only to the web server's address, and set that address in the listen.allowed_clients setting as well:
- UFW:
ufw allow from 10.0.0.10 to any port 9000 proto tcp - firewalld:
firewall-cmd --permanent --add-rich-rule='rule family="ipv4" source address="10.0.0.10" port port="9000" protocol="tcp" accept'
With containers, according to the PHP documentation, don't publish PHP-FPM's port 9000 on the host. Containers on the same network connect to each other directly.
Risks and security
The PHP documentation warns that external access to PHP-FPM allows running arbitrary code on the server. Anyone who reaches port 9000 can send a direct FastCGI request and bypass the web server. The following settings close off that possibility:
- Set PHP-FPM to listen on a Unix socket, or on 127.0.0.1 only, and not with the
listen = 9000setting, which listens on all addresses. - When you use TCP, list only the web servers' addresses in the listen.allowed_clients setting. When the setting is empty, any address can connect.
- With a Unix socket, restrict the file's permissions with the listen.owner, listen.group, and listen.mode settings.
- Make sure port 9000 is blocked in the firewall for every address other than the web server.
Commands to check and configure
-
ss -tlnp | grep ':9000 'Shows which process is listening on port 9000 and on which address. When PHP-FPM listens on 0.0.0.0 or *, it's open to all addresses (requires root for the process details).
-
grep -R "^listen" /etc/php-fpm.d/Shows the listen settings of the PHP-FPM pools. The path fits distributions such as AlmaLinux and Rocky Linux, and on Debian and Ubuntu the settings are under /etc/php.
-
php-fpm -tChecks the PHP-FPM configuration files for errors before a restart. On some distributions, the command name includes the version number.
-
nc -zv 127.0.0.1 9000Checks from the server itself that PHP-FPM accepts connections on port 9000.
-
ufw allow from 10.0.0.10 to any port 9000 proto tcpAllows only the given web server to connect to PHP-FPM on a separate server (UFW).
-
ufw deny 9000/tcpExplicitly blocks incoming connections to port 9000 from any other address (UFW). UFW checks rules in order, so add the deny rule after the allow rule.
-
firewall-cmd --permanent --add-rich-rule='rule family="ipv4" source address="10.0.0.10" port port="9000" protocol="tcp" accept'In firewalld, allows only the given web server to connect to PHP-FPM on a separate server. Then run firewall-cmd --reload.
Port 9000 in the IANA registry
| Port | Protocol | Service | IANA registry description |
|---|---|---|---|
| 9000 | TCP | cslistener | CSlistener |
| 9000 | UDP | cslistener | CSlistener |
Data source: IANA Service Name and Transport Protocol Port Number Registry (opens in a new tab)
Port 9000 FAQ
What's the difference between port 9000 and a Unix socket in PHP-FPM?
Both pass requests from the web server to PHP-FPM. A Unix socket is a special file on the server, and only processes on the same server with the right permissions can use it. Port 9000 also allows a connection from another server. When the web server and PHP-FPM are on the same server, the PHP documentation recommends a Unix socket.
Do I need to open port 9000 in the firewall?
No, when the web server and PHP-FPM are on the same server. Open it only when PHP-FPM runs on a separate server, and only to the web server's address.
Why does a PHP site show a 502 Bad Gateway error?
In many cases, the web server can't connect to PHP-FPM: the service isn't running, or the address in the web server's settings differs from PHP-FPM's listen setting. The 500, 502, 503, and 504 errors page explains the checks.
How do I check which port PHP-FPM is listening on?
Run ss -tlnp | grep php-fpm, or look for the listen setting in the PHP-FPM pool files. When a file path appears instead of a port, PHP-FPM is listening on a Unix socket.