~1 month ago, when setting up my new Macbook it took me forever to debug this. After hours of trying to mess with the builtin Apache service (thinking it was the culprit), I found a random blog post that said to disable the sharing feature occupying the port in the system preferences. It was devilishly hard to debug (and google for) at the time.
For those wondering why I needed port 5000 in my case, it was a standard Svelte app serving on localhost:5000 (via Sirv).