Francisco Romero
Francisco Romero

Reputation: 13189

How can I access from my mobile phone to my XAMPP?

I already had a similar issue some months ago: Why my access from my mobile to my computer network doesn't work?

But this time I cannot get any solution to my problem. I have changed my computer and my network (but it is still a home network) so I think it could be something about configuration but I cannot make it to work.

I already have:

  1. XAMPP running both Apache and MySQL.
  2. Apache is running at port 80.
  3. I have allowed a new enter rule on my firewall to allow connections on that port.
  4. I have connected my mobile phone and my computer to the same network.
  5. I have gone to CMD and use the command ipconfig to see the IP of my computer.
  6. I have put on the browser of my mobile phone the IP that I have got on the step before.

Changes I have tried on httpd.conf file:

  1. Change on <Directory /> the directive Require from denied to allow.
  2. Before Listen 80 line I have put Listen IP of my computer:80.

On my computer I have Windows 10.

What configurations can I prove to solve this? I saw a lot of questions related to the same problem but any of them solved my problem.

Thanks in advance!

Upvotes: 6

Views: 24267

Answers (4)

user2733786
user2733786

Reputation: 1

I've had similar issues with XAMPP and eventually realised that it was a firewall issue.

Use your PC's IP, don't worry about the port. Go to your Firewall settings > Inbound rules > Apache HTTP Server, change to "Allow the connection".

Here's a video that should give you a step through.

Also I found that I had to change the URL references within my local sites from 'localhost' to my pc's IP.

Upvotes: 0

Mitja Gustin
Mitja Gustin

Reputation: 1781

Do you have name based virtual host or ip based virtual host on apache? Just post the first line from apache config? For testing like this, you can have . This will make apache listen to all available network interfaces.

In any case, if it's a security problem (allowed, required) you get to see the page in browser, saying access forbidden.

To troubleshoot stuff like this (to determin if it's a firewall problem), it's best to use tcpdump and telnet programs. On server you are listening with tcpdump, on client you issu requests with telnet.

tcpdump -i eth0 'port 80'

telnet MYIP 80

Upvotes: 0

NetVicious
NetVicious

Reputation: 4037

  1. If you had this:

    <Directory />
            AllowOverride none
            Require all denied
    </Directory>
    

    You need to change it to:

    <Directory />
            AllowOverride none
            Require all granted
    </Directory>
    
  2. If the mobile phone and the computer are connected within wifi to the network, you should log in into your wifi router and look on the options if you have the option Wireless Isolation or Client Isolation or ... isolation enabled, and disable it. This option disables direct connections between wifi clients on the network.

Upvotes: 0

toha
toha

Reputation: 5510

You need ngrok

Run at console/Terminal

ngrok http 80

You will get something like :

ngrok by @inconshreveable

Tunnel Status                 online
Version                       2.0/2.0
Web Interface                 http://127.0.0.1:4040
Forwarding                    http://92832de0.ngrok.io -> localhost:80
Forwarding                    https://92832de0.ngrok.io -> localhost:80

Connnections                  ttl     opn     rt1     rt5     p50     p90
                              0       0       0.00    0.00    0.00    0.00

At the cell phone, open at browser the link like this that appears at the console

Upvotes: 9

Related Questions