|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2009-04-20 09:30 UTC] jani@php.net
[2009-04-21 00:53 UTC] joey@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Dec 25 07:00:02 2025 UTC |
Description: ------------ Hello, I have a system e.g.: hostname: localhost ip1: ::1 ip2: 127.0.0.1 (the problem is not specific to localhost) A fopen('http://localhost/', 'rb'); connect correctly to "::1". But gethostbyname('localhost'); returns "127.0.0.1". gethostbynamel('localhost'); also returns only a array with "127.0.0.1". Well, how can I know which IP PHP is using in a e.g. fopen() call? And if gethostbyname() can't work with IPv6, this should be noted in the PHP manual. From what I can see, gethostbyaddr() is also working only with IPv4 (don't see this in the manual). In phpinfo() i can read: | IPv6 Support enabled Regards, Carsten