Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[DX] Smarter web server commands #21040

Copy link
Copy link
Closed
@javiereguiluz

Description

@javiereguiluz
Issue body actions
Q A
Bug report? no
Feature request? yes
BC Break report? no
RFC? no
Symfony version 3.3

Problem

When using the server:start command in several apps, you must provide a free port number to avoid errors like this one:

$ ./bin/console server:start
  [OK] Web server listening on http://127.0.0.1:8000

(change to other app in other directory)

$ ./bin/console server:start
  [ERROR] A process is already listening on http://127.0.0.1:8000

$ ./bin/console server:start 127.0.0.1:8001
  [ERROR] A process is already listening on http://127.0.0.1:8001

$ ./bin/console server:start 127.0.0.1:8002
  [ERROR] A process is already listening on http://127.0.0.1:8002

  fffffuuuuuuuuuuuu !!!!

Solution

If it's technically possible, I'd like the server:start command to look for a free port automatically. Starting from 8000, check the following N ports and pick the first one available.

Same example as before:

$ ./bin/console server:start
  [OK] Web server listening on http://127.0.0.1:8000

(change to other app in other directory)

$ ./bin/console server:start
  [OK] Web server listening on http://127.0.0.1:8024

Depending on how fast/slow is this process, we could check 10, 100 or 1,000 ports before showing the error message.

Metadata

Metadata

Assignees

No one assigned

    Labels

    DXDX = Developer eXperience (anything that improves the experience of using Symfony)DX = Developer eXperience (anything that improves the experience of using Symfony)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.