Search code examples
phplaravelwindowscomposer-phplaravel-filament

composer dev is starting my other Laravel project


When developing locally on a Windows 11 machine with PHP 8, Laravel 11 and Filament, I adjust my composer.json to have

"dev": [
    "Composer\\Config::disableProcessTimeout",
    "npx concurrently -c \"#93c5fd,#c4b5fd,#fb7185,#fdba74\" \"php artisan serve\" \"php artisan queue:listen --tries=1\" \"npm run dev\" --names=server,queue,logs,vite"
]

so that I can simply run composer dev.

As I'm running a new project, notice i get

[vite] Port 5173 is in use, trying another one...

composer dev showing port in use

and when I go to the admin page to login, I see the page of another project.

The VS Code for that other project and its terminal are closed and I've stopped with CTRL + C which showed something like this

Terminated

I cleared all caches and restarted the Apache web server in XAMPP, but the issue remains.


Solution

  • The solution was to check which processes were running

    netstat -ano | findstr :5173
    netstat -ano | findstr :8000
    

    netstat

    and then open PowerShell and taskkill them

    taskkill /PID 3676 /F
    taskkill /PID 26668 /F
    

    taskkill processes

    Now when I start the project the other port isn't being used

    the port is not being used this time

    and I'm able to see the proper project

    Php 8 Laravel 11 and Filament Dashboard