WAMP Server
If you use the WAMP Server, is quite simple.
- Click the WAMP icon in the Windows notifications area and click "Put Online":
- Discover the IP of your computer on your network. To do this, open the command prompt and type ipconfig
. Copy the IP that is right after "Ipv4 Address":
- Type the IP of your computer in your mobile browser and voilà. You may need to confirm the request in your computer’s firewall:
XAMPP
In XAMPP, edit the file C:\xampp\apache\conf\extra\httpd-xampp.conf
Turn this:
<LocationMatch "^/(?i:(?:xampp|security|licenses|phpmyadmin|webalizer|server-status|server-info))">
Require local
ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var
</LocationMatch>
Therein:
<LocationMatch "^/(?i:(?:xampp|security|licenses|phpmyadmin|webalizer|server-status|server-info))">
#Require local
#ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var
</LocationMatch>
Then restart Apache by XAMPP Control Panel. And test on your phone using the computer’s IP, as shown in the tutorial for WAMP.
What webserver are you using?
– Thomas
Assuming you’re using Apache, put
Allow from all
in an archive.htaccess
at the root of the site you are testing. The default instruction for localhost in Apache is to accept connections only from IP 127.0.0.1, that is, the computer that hosts it itself, and your mobile phone will have a different IP at the time of connection.– Thomas
If you are using some type of router (from the net or other carrier) and the real IP is not inside your computer, you will need to redirect port 80 on your router to your computer.
– Marcelo Gomes