treehouse : what would you like to learn today?
Web Design Web Development iOS Development

Using xampp "localhost" for testing

  • does anyone know how to set up the "localhost" so that a mobile device could open up a site in xampp?

  • You may want to look into this: https://showoff.io/

  • thanks ... ill check it out

  • Also checkout xip.io

    I use that for locally testing on mobiles/tablets.

  • a service like that is kinda overkill - if you have wireless, you can view your localhost directly from your phone/tablet/whatever.

    Use the IP address of the machine you have XAMPP set up on (e.g., http://xxx.xxx.xxx.xxx/index.html) - works just fine.

  • Traq,

    The mobile device recognized the xampp install, so I tried using the http://xxx.xxx.xxx.xxx/wp/wp-admin/index.html ... but it switched the IP to "localhost" and said Web page not available. ...

  • Andy,

    yea ... I checked out the xap.io ... it seems to be a bit over my head at least for the moment ... thanks though for the recommendation ... I am gonna bookmark it though ...

  • Nathan - you need to edit the site/wordpress address in the backend of Wordpress or directly into the SQL.

    Change it from Localhost to the IP address of the machine. You'll then be able to access it to the IP address from other devices - but note you'll also have to access it via the IP even on the host machine for WP to work properly.

    XIP.io is awesome if you have virtual hosts setup - like a fake/dummy domain. For example I use MAMP Pro on my Mac so I have tons of testing domains. Example, manor.uit, eengine.dev etc. So when I want to access those on other devices, I put manor.192.168.0.xxx.xip.io in and it can connect to those individual domains rather than just localhost.

  • @andy_unleash - thanks for the reference to this great testing tool. I'm trying to use it, and am able to access the IP address on the hosting machine, however, for some reason it is only pulling the html file. It's not grabbing all the rest of the locally hosted files, such as: css, javascript, plugins, etc. How did you work that out? Thanks

  • If it's Wordpress it will be looking for the CSS/JS files etc at wordpresslocation.whatever/wp-content/themes/etcetc

    What you need to do is go into the SQL (or indeed into WP-ADMIN) and change the siteurl & wordpress URL to the address you're going to use to access it, for example sitename.ipaddress.xip.io

    That way when you load it up from another device all of the URL's for files etc will be correct and able to be accessed.

  • http://browserstack.com too

    You can set up a local tunnel and then use their slew of emulators.