acoder
acoder

Reputation: 1085

error when i used my ip address instead of localhost as URL

I have downloaded WAMP server and i have written a very very simple php code and saved it in

C:\wamp\www\php_lear

folder. I have tested it using chrome giving url as

{localhost/php_lear/eg2.php}

And it worked fine. This uses a database stored in phpmyadmin. I found out my ip address from google 117.195.230.41. When i give

{117.195.230.41/php_lear/eg2.php}

as URL it gives me 404 not found

"The requested URL '/php_lear/eg2.php' was not found on this server"

Please help. I have no knowledge of ips and urls and very new to this field and yeah i have added this ip as allowed user in phpmyadmin. I actually want to use this in my android app.

Upvotes: 0

Views: 1806

Answers (2)

user2616204
user2616204

Reputation:

The Public/Private IP confusion is a common misunderstanding.

Mike is correct. Due to how IP addressing works, there's a limited number of addresses. As a result, Network Address Translation was born (among other irrelevant things). The Public IP is what the world sees when it glances at your traffic. You want your Private IP, the one your router's DHCP has given you.

1) Open command prompt.

2) Issue the command "ipconfig" (without the quotes).

3) Find your "IPv4 Address". That's the one you want.

Additionally, follow Surt's suggestion to get everything working properly.

Upvotes: 1

Surt
Surt

Reputation: 611

The IP address you get from google is the IP address of your router. It does not point to your computer. As some ppl said, besides there is different ports to use in a connection and your WAMP installation is "listening" on the port 80 of your computer (127.0.0.1)

When you access to the 117.195.230.41 you are accessing to the IP that your Internet Service Provider gives to your installation. So you need to access your router and redirect all the querys to the 117.195.230.41 on port 80 to your port 80 and the IP of your computer in your local network.

Upvotes: 1

Related Questions