404 on fresh sites

Newly created sites (latest version of Local, fresh install, latest WP version) give me a 404 (also via Live Link), both http and https. Mailpit and NeoAdmin working fine but site can’t load. Loding https it says database connection error.


Not sure how to replicate. I’m using Mac Intel i7 running Monterey (last compatile MacOS with my machine), latest LocalWP and WordPress versions, tried different MySQL and PHP, also tried Apache instead of NGinx. 404.

I’ve managed to restore an old backup that always gave me errors on LocalWP previous versions. But it’s the only site I’ve managed to run. Any fresh install will return 404 errors constantly.


System Details

Local Version: Latest Version 9.2.4+6788 for MacOS (on Intel i7)

Operating System (OS) and OS version: MacOS Monterey 12.7.6 (21H1320)


Attach your Local Logs here (Help Doc - Retrieving Local’s Log)

error.log (269.3 KB)
local-lightning-verbose.log (44.0 KB)
local-lightning.log (25.7 KB)

It seems some routing issue. LocalWP suggests to change Site Domains to localhost, but this wouldn’t work for me as I need HTTPS to work.

LocalWP is writing on my hosts file, but it points conflicts all the time. Despite the Site Domain error on LocalWP, my restored Multisite works perfectly including HTTPS. It only fails the GZip compression (that is supposedly active on Nginx Server at LocalWP) and Browser Cache (also on nginx.conf).

Hi @fabiofava

When you say newly created sites are giving a 404 are you talking about a new, blank site in Local or are you creating subsites for your multisite install that are throwing 404s?

Based on your logs it does seem like there might be a port conflict at play. Are you running other developer applications simultaneously? That could also cause similar issues. Apps like MAMP, XAMPP, or Docker for example.

Here are some additional steps to help troubleshoot:

  • Stop all sites that are running in Local

  • Force quit Local

  • (If using Mac) Run the command lsof -nP -iTCP -sTCP:LISTEN

  • (If using Windows) Run the command netstat -ano

What you’ll be looking for here is to see when sites are stopped and Local is properly shut down if there are still programs running on ports 80 and 443. These may be conflicting with Local or the system may be reporting Local is still running.

Once you run that command you should see a list of listening ports. If you see a particular program making use of those ports, you can then kill that process by running sudo kill -9 XXX where XXX is the PID number of that process. (On Windows you will use taskkill /F /pid XXX where XXX is the PID number of that process)

There are also some more details around this and other troubleshooting steps at this link if needed: Stopping Whatever Is Listening On Port 80.

1 Like

If I change to localhost the website loads. But most plugins won’t work when API access is needed (since a domain even local is needed).

Hey @Nick-B thank yo so much for your help!

I’m not using any other local develpment environment. My system never had any other than LocalWP, and sicne I’ve upgraded to Monterey, it’s my first time now with LocalWP after a few years away (couldn’t restore my Local site). Below are the ports my Mac was listening to:

I’ve killed them all, and it worked. In case it happens again I’ll know what to do, or by comming back to this ticket to remember how to fix it.

Thank you so much for your prompt and helpful insight! Cheers!

1 Like

Glad to hear it @fabiofava! Thank you for following up and letting us know! :green_heart:

1 Like

This topic was automatically closed 36 hours after the last reply. New replies are no longer allowed.