• Hi, have a live site – florapal.org that I need to do some work on, so I’ve installed the wordpress site on my windows 10 + xampp and it appears ok. My problem is I’m unable to access the site on my mobile. I’m using the same wi-fi connection on my pc and mobile, I’ve changed the ip address in wp-config.php for WP_HOME & WP_SITEURL, but when I change DB_HOST from Localhost to ip address I get “Error establishing a database connection”, also in dashboard > settings > general the WordPress address (URL) and Site address (URL) are disabled. My question is how do I access a localhost wordpress site on a mobile device? Thanks for any help.

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • The address localhost, by convention, points to the specific device you’re accessing it from. If you access it from your computer, it’s pointing to that computer; and if you access it from your mobile device, it’s pointing to the mobile device.

    So you can’t access a localhost URL you set up on your computer from your mobile device.

    You need to change your WordPress address to something else other than localhost. You could use the IP address for the computer, or you could even make up any domain name (doesn’t have to be registered)… but set up your computer and mobile (or network) to resolve that made-up domain name to your computer’s IP address.

    … but when I change DB_HOST from Localhost to ip address I get “Error establishing a database connection”

    Leave your DB_HOST pointed to localhost — because your mobile isn’t making any connection to the database host directly. WordPress is making the connection, and WordPress lives on your computer, the same place where the database server lives.

    You first need to get VHost working in your Apache/XAMPP. Please see: https://www.edgewebware.com/2014/09/virtual-host-configuration-xampp/

    Then you’ll have to either set up a new WordPress with the new address, or change your existing WordPress site to use the new address.

    Alternatively, you could ditch XAMPP altogether, and use Local as it makes the setup a breeze.

    Thread Starter blogdropper

    (@blogdropper)

    Hi George, I took your suggestion to “Alternatively, you could ditch XAMPP altogether, and use Local as it makes the setup a breeze.” I’ve installed Local but the site doesn’t appear in the Local dashboard, how do I add it? Thanks for your help

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘access wordpress localhost on mobile’ is closed to new replies.