Whats up with my local ip address?
-
I'm trying to create a PHP script for my homework. I need the script to log ip addresses for security reasons. For some reason, when I run the following code: echo $_SERVER['REMOTE_ADDR']; The result is : ::1 I thought a localhost ip address was always like 127.0.0.1 ? Does anyone know what is happening ? This is really bugging me and I can't seem to find a solution to the problem. Even google doesn't find anything related... I should mention that I'm running an XAMPP installation on a windows 7 64bit machine. Thanks in advance.
-
Answer:
On Windows 7 localhost resolves to ::1 which is the ipv6 representation of 127.0.0.1 Open C:\Windows\System32\drivers\etc\hosts Remove the following line, if present: ::1 localhost Add the following line, if not present: 127.0.0.1 localhost if you also need mysql connection, it will help you to speed up the connection.
Joel Murphy at Stack Overflow Visit the source
Other answers
::1 is an http://en.wikipedia.org/wiki/IPv6 http://en.wikipedia.org/wiki/Loopback/localhost address, as 127.0.0.1 is for http://en.wikipedia.org/wiki/IPv4. Your system can have an IPv4 and and IPv6 address if it is properly configured. The fact that you're seeing this indicates that your sever is supporting IPv6. It may also be supporting IPv4. When a server has multiple addresses, magic globals like REMOTE_ADDR will only show one of them (typically the one which will be used by default).
Jeremy Banks
::1 is the localhost address under http://en.wikipedia.org/wiki/IPv6 127.0.0.1 is the localhost address under http://en.wikipedia.org/wiki/IPv4.
J.Kommer
This is your IPv6 address, see http://en.wikipedia.org/wiki/IPv6
topek
::1 is the IPv6 version of 127.0.0.1. If you google IPv6, you should get a lot further. Good luck!
toon81
Related Q & A:
- How can I get the IP address of the person through his email address?Best solution by Yahoo! Answers
- How do you use another IP address?Best solution by Yahoo! Answers
- How can I change my IP address ?Best solution by Yahoo! Answers
- How does one hide their IP address?Best solution by Super User
- How to fool an IP address Tracer into believing another IP address?Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.