skip to Main Content

I’m making an iPhone app communicating (REST) with a PHP web app on wordpress on my local server using XAMPP (version 7.2.7-0).

The problem is that I can’t reach my local server with my phone whereas I use to do it using the address http://localhost:8080.

I already tried several things I found on this forum an others:

Not sure I did it in the good order or correctly, so don’t think it cannot be the solution to use those solutions 🤪

I should reach my XAMPP local server on my Mac using my iPhone. I know it is possible, but I don’t know really know how…

Edit:
I checked which ports are open on the different IP adresses using the app “Network utility”:

  • 192.168.64.2 (XAMPP): 80 is open

  • 127.0.0.1: 8080 is open

  • 192.168.X.X my computer’s local IP address: NOTHING

Maybe should I try to open the port 8080 on my local address?

2

Answers


  1. Chosen as BEST ANSWER

    Finally I used a software named SquidMan to create a proxy. The procedure is described here: http://egalo.com/2012/05/29/testing-mac-web-site-using-local-hostname-on-mobile-device/

    Advices:

    • do not use your localhost port in your proxy's settings (I used 8000 instead of 8080)

    • add an URL associated to your localhost in your /etc/hosts like "127.0.0.1 my_local_website"

    • It seems that sometimes you have to restart your computer for SquidMan to take into account your setting


  2. If they’re already on the same wifi network then you should be able to reach it through the host PC’s IP Address.

    Maybe if that doesn’t work try and connect the computer to a hotspot on your phone (no internet needed) and it should show you a list of connected devices with their IP addresses and you can hard code that value in your app.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search