I have 2 instances of the same WP site in Local, the first one was originally created early this year and another that was just created (I tried both duplicating the site through LocalWP and manually duplicating the instance) but for some reason, when I run Webpack, the old instance has no issues running while the new instance is showing a 502 Request Error.
I already tried downgrading to an earlier version of LocalWP but it didn’t work.
Note that this is only happening when I try to access the localhost, it works fine when using the .local URL but I need it to also run through localhost due to some compilers (the setup of which is outside of my control). I’m not sure what’s causing the issue and where to look for what might be causing said issue.
So just to TL;DR:
2 instances of the exact same site.
Older one (created early this year) works with no issues.
New one (replicated today) runs on .local but doesn’t work on localhost:3000
TYIA for the help. Sorry if this is actually a super basic question, I’m not too familiar with WP and LocalWP. error.log (600.2 KB)
Are you running other developer applications simultaneously? That could also cause similar issues. Apps like MAMP, XAMPP, or Docker for example.
It could be that there is a port conflict happening, so do troubleshoot this you could do the following:
Stop all sites that are running in Local
Force quit Local
(If using Mac) Run the command lsof -nP -iTCP -sTCP:LISTEN
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.
After that, you should be able to retry. Keep us posted if you have any questions or continuing issues.
I don’t think these would cause port conflict but just to be thorough, I closed all of them until nothing is appearing once I run the command (see screenshot), and then re-launched LocalWP but it still didn’t work.
Not sure if this would help but while running it, this appeared:
Fyi, it started working last night but I do not understand/know what happened between the time I was trying to make it work vs the time it actually started working because I just literally took a bit of time to cook and eat (left my computer running the whole time). There might be something that conflicted with the port, as you said, just weird that it’s not showing up.
Anyways, just wanted to update that it’s ok now, thank you again for the assistance.