Is it possible to access the localhost from my laptop on my iPhone?


#1

Hey everyone,

Is it possible to access the localhost provided by XAMPP on my latpop on my iPhone for development purposes?

Is there a safe way other than playing with ports etc…

  • Taha

#2

Your On a Mac right? If so use Xcode/developer tools, but other than that you’ll have to go with IP + ports


#3

You can connect over WiFi to the ip address of your computer. Were you talking about accessing it over 3g? For that you’d have to forward a port on your router to that ip, or create a VPN


#4
OrganicBeeMedia said

Your On a Mac right? If so use Xcode/developer tools, but other than that you’ll have to go with IP + ports

im not on a mac sadly :frowning:


#5
fillerspace said

You can connect over WiFi to the ip address of your computer. Were you talking about accessing it over 3g? For that you’d have to forward a port on your router to that ip, or create a VPN

yup my iphone is connected over wifi, can you tell me how to set it up so I can access the localhost? I guess connecting over wifi wont require ip and ports editing


#6
wizylabs said
fillerspace said

You can connect over WiFi to the ip address of your computer. Were you talking about accessing it over 3g? For that you’d have to forward a port on your router to that ip, or create a VPN

yup my iphone is connected over wifi, can you tell me how to set it up so I can access the localhost? I guess connecting over wifi wont require ip and ports editing

visit the internal ip of the pc with the web sever on it.


#7
wizylabs said

yup my iphone is connected over wifi, can you tell me how to set it up so I can access the localhost? I guess connecting over wifi wont require ip and ports editing

find out the local ip address of your computer (eg: Start > Run > cmd > ipconfig, or go to the networking section in control panel) it may be something like 192.168.0.123 or 10.0.0.123

then just wack that into your phone if you’re connected on local wifi: http://192.168.0.123 or whatever.

if it doesn’t work make sure apache or whatever you are using is not bound to localhost only.


#8
dtbaker said
wizylabs said

yup my iphone is connected over wifi, can you tell me how to set it up so I can access the localhost? I guess connecting over wifi wont require ip and ports editing

find out the local ip address of your computer (eg: Start > Run > cmd > ipconfig, or go to the networking section in control panel) it may be something like 192.168.0.123 or 10.0.0.123

then just wack that into your phone if you’re connected on local wifi: http://192.168.0.123 or whatever.

if it doesn’t work make sure apache or whatever you are using is not bound to localhost only.

okai tried that but I have a simple issue (might not be), i have few virtual hosts setup on my machine, just for web apps etc… now when I visit my ip address, it reads one of the virtual hosts and not the localhost, I mean it opens the virtual host directory and not the htdocs folder.

what can I do :smiley: ?


#9
wizylabs said
dtbaker said
wizylabs said

yup my iphone is connected over wifi, can you tell me how to set it up so I can access the localhost? I guess connecting over wifi wont require ip and ports editing

find out the local ip address of your computer (eg: Start > Run > cmd > ipconfig, or go to the networking section in control panel) it may be something like 192.168.0.123 or 10.0.0.123

then just wack that into your phone if you’re connected on local wifi: http://192.168.0.123 or whatever.

if it doesn’t work make sure apache or whatever you are using is not bound to localhost only.

okai tried that but I have a simple issue (might not be), i have few virtual hosts setup on my machine, just for web apps etc… now when I visit my ip address, it reads one of the virtual hosts and not the localhost, I mean it opens the virtual host directory and not the htdocs folder.

what can I do :smiley: ?

You’ll either have to change the host file on your iPhone or change the config of the server to respond on different ports, e.g.192.168.1.123:8010


#10

Wizy, you need to become a mac fan boy and get yourself a mac! Then I could tell you step by step with how to do it with MAMP. I have my localhost in my house setup to show on all different PC’s, Macs, and mobile devices in the house, and I’m no where near as smart as dtbaker and fillerspace… It’s a beautiful thing for development, and you’re missing out :slight_smile:


#11
ThemeBlvd said

Wizy, you need to become a mac fan boy and get yourself a mac! Then I could tell you step by step with how to do it with MAMP. I have my localhost in my house setup to show on all different PC’s, Macs, and mobile devices in the house, and I’m no where near as smart as dtbaker and fillerspace… It’s a beautiful thing for development, and you’re missing out :slight_smile:

+100000 but I think wizy knows my dev setup mostly :slight_smile:


#12
ThemeBlvd said

Wizy, you need to become a mac fan boy and get yourself a mac! Then I could tell you step by step with how to do it with MAMP. I have my localhost in my house setup to show on all different PC’s, Macs, and mobile devices in the house, and I’m no where near as smart as dtbaker and fillerspace… It’s a beautiful thing for development, and you’re missing out :slight_smile:

I work on a mac and i use MAMP and i tried several times to access to my localhost with my iPad without any luck :frowning:


#13
manu3l9816 said

I work on a mac and i use MAMP and i tried several times to access to my localhost with my iPad without any luck :frowning:

All you do is put in the IP address of your computer running MAMP with your port number like this:

http://XX.X.X.X:8888

(If you haven’t changed any MAMP settings, by default the port number is going to be 8888)

And one little trick I found for idiots like me to figure out this mysterious “IP address” thing is to go System Preferences > Sharing, and temporarily turn on “Web Sharing” just so it will show you your IP.

And obviously, you need to make sure your iPad (or whatever device) is using your local wifi.


#14
ThemeBlvd said

Wizy, you need to become a mac fan boy and get yourself a mac! Then I could tell you step by step with how to do it with MAMP. I have my localhost in my house setup to show on all different PC’s, Macs, and mobile devices in the house, and I’m no where near as smart as dtbaker and fillerspace… It’s a beautiful thing for development, and you’re missing out :slight_smile:

Im seriously thinking of gettin a mac ASAP :slight_smile:


#15
ThemeBlvd said
manu3l9816 said

I work on a mac and i use MAMP and i tried several times to access to my localhost with my iPad without any luck :frowning:

All you do is put in the IP address of your computer running MAMP with your port number like this:

http://XX.X.X.X:8888

(If you haven’t changed any MAMP settings, by default the port number is going to be 8888)

And one little trick I found for idiots like me to figure out this mysterious “IP address” thing is to go System Preferences > Sharing, and temporarily turn on “Web Sharing” just so it will show you your IP.

And obviously, you need to make sure your mobile is using your local wifi.

Thank’s, that’s great, now i only need to figure out this: i use MAMP PRO, and i have created multiple hosts, one for every website i create, with your help i can access to the default localhost but not to the rest of the hosts i’ve created.


#16
manu3l9816 said

Thank’s, that’s great, now i only need to figure out this: i use MAMP PRO, and i have created multiple hosts, one for every website i create, with your help i can access to the default localhost but not to the rest of the hosts i’ve created.

Sorry I have no idea. My setup is so simple, but that’s about the extent of my limited server knowledge. I’ve never used MAMP pro, I just file all my sites under different directories of my local host.


#17
Thank's, that's great, now i only need to figure out this: i use MAMP PRO, and i have created multiple hosts, one for every website i create, with your help i can access to the default localhost but not to the rest of the hosts i've created.

I don’t know how to target specific websites. But I do know that you can access the localhost directory. In MAMP the first default host is “localhost”, if you change the Disk location to the directory of your website, you can access the website on your iPad.

You’ll have to change this every time you want to see a different site.

Just follow ThemeBlvd instructions, and make sure you change MAMPS local host disk location directory.