Site Host change , cant access database

Issue Summary

One or two sentence summary of the issue.
Local was having trouble loading the server up (continuos three dots) it eventual prompted that it will change ports. After clicking on that prompt. My Site Host change from the project name (called fictional-unverisity ) to localhost:10008 now I am unable to connect to the DB and the server.
this code was working before (strstr( $_SERVER[‘SERVER_NAME’], ‘fictional-university.local’ )) and now it wont because the site host has change… I tried inserting ‘local:10008’ instead of fictional-unviersity.local, but that does not work either… How can I change the Site Host back from local:10008 to fictional-university.local.

Troubleshooting Questions

  • Does this happen for all sites in Local, or just one in particular?
    It is now happening on all of my project. All projects have been moved from Site Host to a new local port

  • Are you able to create a new, plain WordPress site in Local and access it in a Browser?
    I can create a new one wordpress site, However instead of the Site Host being called the project name, the site host is being set to a new local port number

Replication

Describe the steps that others can take to replicate this issue. If you have screenshots that can help clarify what is happening, please include them!

System Details

  • Which version of Local is being used?
    5.9.4+5115

  • What Operating System (OS) and OS version is being used?
    macOS Catalina 10.15.7

  • Attach the Local Log. See this Community Forum post for instructions on how to do so:

local-lightning.log (358.8 KB)

What you’re describing sounds like Local was trying to use the default port of 80, but something else was already listening on that port.

Because only one tool can use that port at a time, Local reverted to localhost Router Mode.

You’ll need to either:

  1. Stop both applications, and only start the one that you are wanting to use at that time.
  2. Re-work the code to use the direct localhost:10008 connection

It’s hard to say what the other piece of software is that is using port 80. Here are a few other forum topics that are related to what you are seeing:

Since you are on a Mac, this might help you zero in on the other application that is preventing Local from using Port 80:

sudo lsof -i ':80'

Once you figure out what’s occupying that port and stop it, then you can navigate to “Preferences > Advanced > Router Mode” in Local, and change it to Site Domains to have Local attempt to use port 80 again for the pretty URLs.

Here’s a help doc that has more info about Local’s Router Mode:

1 Like

Thank you, that did the trick! Stopping the other program from suing port 80 and then going to the advanced topic

1 Like

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