#48008 [Opn->Csd]: gethostbyname does not return IPv6 addresses

From: Date: Tue, 21 Apr 2009 00:53:31 +0000
Subject: #48008 [Opn->Csd]: gethostbyname does not return IPv6 addresses
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-2117@lists.php.net to get a copy of this message
 ID:               48008
 Updated by:       joey@php.net
 Reported By:      carsten_sttgt at gmx dot de
-Status:           Open
+Status:           Closed
 Bug Type:         Documentation problem
 Operating System: Windows_NT
 PHP Version:      5.2.9
 New Comment:

This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation
better.

gethostbyname and gethostbynamel are now documented as giving the
"IPv4
address"


Previous Comments:
------------------------------------------------------------------------

[2009-04-20 09:30:56] jani@php.net

See also bug #33170

------------------------------------------------------------------------

[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



Thread (2 messages)

« previous php.doc.bugs (#2117) next »