Closed
Description
- Laravel Version: 8.x-dev
- Jetstream Version: 0.6.0
- PHP Version: 7.4.9
- Database Driver & Version: SQLite 3.22
Description:
Development server (run with ./artisan serve
) cannot listen on same port after .env file reloaded, and starts another server on one port higher. The existing dev server is not shut down when the .env file is edited and saved, so the port's already in use.
Steps To Reproduce:
- Create fresh Laravel project using the new installer:
laravel new foo --jet --dev
. - Configure the database details in
.env
, then run migrations with./artisan migrate:fresh
. - Serve the project with
./artisan serve
- a local dev server is successfully started on port 8000 - Modify the .env file and save - a new local dev server is started on port 8001
- http://localhost:8000 and http://localhost:8001 both serve my project.
paul@ubuntu:~/projects/foo$ ./artisan serve
Starting Laravel development server: http://127.0.0.1:8000
[Thu Sep 3 16:56:31 2020] PHP 7.4.9 Development Server (http://127.0.0.1:8000) started
[Thu Sep 3 16:56:45 2020] 127.0.0.1:51424 Accepted
[Thu Sep 3 16:56:45 2020] 127.0.0.1:51424 Closing
# .env file is modified.
Environment modified. Restarting server...
[Thu Sep 3 16:57:42 2020] Failed to listen on 127.0.0.1:8000 (reason: Address already in use)
Starting Laravel development server: http://127.0.0.1:8001
[Thu Sep 3 16:57:42 2020] PHP 7.4.9 Development Server (http://127.0.0.1:8001) started
# .env file is modified again.
Environment modified. Restarting server...
[Thu Sep 3 16:58:25 2020] Failed to listen on 127.0.0.1:8001 (reason: Address already in use)
Starting Laravel development server: http://127.0.0.1:8002
[Thu Sep 3 16:58:25 2020] PHP 7.4.9 Development Server (http://127.0.0.1:8002) started