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

[WebServerBundle] Store pid file in project directory instead #29160

Copy link
Copy link
Closed
@nclavaud

Description

@nclavaud
Issue body actions

Description

Commit 6f689d6 introduced a pid file to keep track of the servers that have been started using command server:start. As stated in the pull request description:

the web server now stores its address in a pid file stored in the current directory

The current directory is the directory where the shell command was launched, and not necessarily the project directory. This can lead to wrong reports if the same command is run twice from different directories, or if different servers (from different apps) are started from the same directory.

For these reasons, I suggest using the project directory instead.

Example (same app, change current directory)

Before

php bin/console server:start  // [OK] Server listening on http://127.0.0.1:8000

cd bin
php console server:start      // [OK] Server listening on http://127.0.0.1:8001

After

php bin/console server:start  // [OK] Server listening on http://127.0.0.1:8000

cd bin
php console server:start      // [ERROR] The web server is already running (listening on http://127.0.0.1:8000).

Another example (different apps, same directory)

Before

php /var/www/app1/bin/console server:start  // [OK] Server listening on http://127.0.0.1:8000
php /var/www/app2/bin/console server:start  // [ERROR] The web server is already running (listening on http://127.0.0.1:8000).

After

php /var/www/app1/bin/console server:start  // [OK] Server listening on http://127.0.0.1:8000
php /var/www/app2/bin/console server:start  // [OK] Server listening on http://127.0.0.1:8001

What do you think?

Metadata

Metadata

Assignees

No one assigned

    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.