cybernet Posted August 8, 2009 Share Posted August 8, 2009 i'm using ubuntu 9.04 desktop with php 5.2.6 & lighttpd server when i echo $_SERVER['REMOTE_ADDR']; i get ::ffff:my.IP instead of my.IP example - i get ::ffff:127.0.0.1 instead of 127.0.0.1 what's wrong ?? how can i solve this ? when i used ubuntu 8.04 i never had this problem Quote Link to comment https://forums.phpfreaks.com/topic/169321-problem-with-my-ip/ Share on other sites More sharing options...
trq Posted August 8, 2009 Share Posted August 8, 2009 This means your using ipv6 instead of ipv4, nothing to do with php. Whats the output of.... cat /etc/hosts Quote Link to comment https://forums.phpfreaks.com/topic/169321-problem-with-my-ip/#findComment-893484 Share on other sites More sharing options...
cybernet Posted August 8, 2009 Author Share Posted August 8, 2009 127.0.0.1 localhost 127.0.1.1 cfn # The following lines are desirable for IPv6 capable hosts ::1 ip6-localhost ip6-loopback fe00::0 ip6-localnet ff00::0 ip6-mcastprefix ff02::1 ip6-allnodes ff02::2 ip6-allrouters ff02::3 ip6-allhosts it's already on ipv4 at least that what ubuntu says ( see screenshot ) [attachment deleted by admin] Quote Link to comment https://forums.phpfreaks.com/topic/169321-problem-with-my-ip/#findComment-893485 Share on other sites More sharing options...
cybernet Posted August 8, 2009 Author Share Posted August 8, 2009 can you help me to work this out to solve the problem with my php * even if is not his fault Quote Link to comment https://forums.phpfreaks.com/topic/169321-problem-with-my-ip/#findComment-893488 Share on other sites More sharing options...
trq Posted August 8, 2009 Share Posted August 8, 2009 I've reported this thread so it will be moved to Linux Help. Yeah, when I said your using ipv6 I didn't actually mean using it, I just meant your OS is configured to handle being on an ipv6 network if need be. As for helping, I'll try but Ive not delt with ipv6 as of yet. One of the first things on do on new Debian or Ubuntu installs however is to remove all the ipv6 stuff from my hosts file. Not sure if it will help, but Id comment out those lines and restart networking to see if it has any effect. Quote Link to comment https://forums.phpfreaks.com/topic/169321-problem-with-my-ip/#findComment-893490 Share on other sites More sharing options...
cybernet Posted August 8, 2009 Author Share Posted August 8, 2009 no effect if i comment those lines Quote Link to comment https://forums.phpfreaks.com/topic/169321-problem-with-my-ip/#findComment-893523 Share on other sites More sharing options...
steviewdr Posted August 9, 2009 Share Posted August 9, 2009 See: http://www.mail-archive.com/php-general@lists.php.net/msg190893.html You could just do a substr() to get the ipv4 address from the complete address. -steve Quote Link to comment https://forums.phpfreaks.com/topic/169321-problem-with-my-ip/#findComment-894188 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.