Closed
Description
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?