How can I stop a symfony process which is listening on http://127.0.0.1:8000

How can I stop a symfony process which is listening on http://127.0.0.1:8000

  1. Blog
  2. 15 November 2026
  3. 3 min read

Stefan Bogdanescu

Founder & Senior Architect

How can I stop a symfony process which is listening on http://127.0.0.1:8000

When you attempt to run php bin/console server:run in a Symfony project, the console immediately halts with an error stating that a process is already listening on http://127.0.0.1:8000. This happens because the Symfony development server binds exclusively to a single port; if another instance is occupying that address, the new command fails before it can start. The most common scenario involves a previous session where you ran the server in a separate terminal window or left a process running in the background without realizing it.

To resolve this, you need to identify and terminate the specific PHP process holding the port. On Ubuntu 14.04, the standard approach involves using the lsof (list open files) utility to inspect which processes have the port open. You can run the following command:

lsof -i :8000

This output will display a table containing the file descriptor, type of process, PID (Process ID), user, and the full path to the executable. Look for the line where the USER column matches your current login or where the COMMAND is php. Note down the PID associated with that process. Once identified, you can terminate it using:

kill -9 <PID>

Replace <PID> with the actual number found in the lsof output. The -9 flag sends a SIGKILL signal, which forces the process to stop immediately without attempting a graceful shutdown. While graceful shutdowns are preferred for production applications, forcing the kill is acceptable here because you are interrupting a local development tool that is not serving real traffic.

If lsof is not installed on your Ubuntu 14.04 machine, you can achieve the same result using netstat. Run this command to find the PID listening on port 8000:

netstat -tlnp | grep :8000

The output will show the listening address and the PID/Program name in parentheses. You can then apply the same kill command using the extracted PID. Alternatively, modern systems often support fuser:

fuser -k 8000/tcp

This command specifically targets port 8000 and kills any process using it. If you are on a newer version of Ubuntu or use systemd-based environments, you might also try systemctl if the Symfony server was registered as a service, though for manual console runs, direct PID termination is usually necessary.

A critical pitfall to avoid is simply restarting the terminal session or closing the window without killing the process. If you ran php bin/console server:run in a detached state or if it was backgrounded with &, closing the shell does not automatically terminate the PHP child processes. The OS continues to allocate resources to that PID until you explicitly kill it.

If you frequently encounter this issue during development, consider adopting a workflow where you always run the server in a terminal window that is easy to close. Before starting a new instance, verify that no previous instances are running by checking the active PHP processes:

ps aux | grep 'bin/console'

This helps prevent accidental port conflicts and ensures a clean slate for every development session. For teams managing multiple environments, always ensure that local development ports do not conflict with production load balancers or reverse proxies, which often listen on 127.0.0.1. If you are integrating Symfony into an existing architecture where port 8000 is reserved for another service, modify the server configuration to use a different port by passing the -p flag:

php bin/console server:run -p=8080

This flexibility allows you to bypass the conflict without needing to hunt down and kill existing processes.

Our network