ID: 48008
Updated by: jani@php.net
Reported By: carsten_sttgt at gmx dot de
Status: Open
-Bug Type: Network related
+Bug Type: Documentation problem
Operating System: Windows_NT
PHP Version: 5.2.9
New Comment:
See also bug #33170
Previous Comments:
------------------------------------------------------------------------
[2009-04-17 21:10:38] carsten_sttgt at gmx dot de
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
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=48008&edit=1