|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #46645 gethostbyaddr() does not work with IPv6
Submitted: 2008-11-22 16:50 UTC Modified: 2008-11-23 21:53 UTC
Avg. Score:4.7 ± 0.5
Reproduced:2 of 3 (66.7%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: carrerag at hotmail dot com Assigned: pajoye (profile)
Status: Wont fix Package: Network related
PHP Version: 5.2.7RC4 OS: Windows XP
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
Solve the problem:
44 - 38 = ?
Subscribe to this entry?

 [2008-11-22 16:50 UTC] carrerag at hotmail dot com
gethostbyaddr() function does not work properly. At least not on my Windows XP platform.  This is with both versions 5.2.6 and with the latest snapshot 5.2.7RC4.  
This function does work properly in version 5.3alpha however, I cannot use that version due to other compatibility issues.

Reproduce code:
echo gethostbyaddr ( '2001:470:0:64::2' );

Expected result:
Return ""

Actual result:
PHP Warning:  gethostbyaddr() [<a href='function.gethostbyaddr'>function.gethostbyaddr</a>]: Address is not in a.b.c.d form in C:\www\tests\saved\host.php on line 2


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2008-11-23 20:46 UTC]
The error message is displayed only when ipv6 support is disabled in PHP (else you get "Address is not a valid IPv4 or IPv6 address"). Maybe you compiled PHP without ipv6 support, or your system does not support ipv6.
 [2008-11-23 21:04 UTC] carrerag at hotmail dot com
These are the windows builds downloaded from and phpinfo shows that ipv6 is enabled on each version I have tried.  Plus, php 5.3alpha2 works fine with that function with no other changes to the machine other than the .ini file which needs to be modified slightly for each version.

I'm not trying to be argumentative but I just don't understand what else could possibly cause the problem.  I do realize that XP doesn't have the greatest IPv6 implementation but the fact that it works with 5.3 must mean there is something different between the versions I tested.  I'm willing to run some tests if you think it is necessary.
 [2008-11-23 21:53 UTC]
Only 5.3+ will have new features for Windows.
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Thu Oct 05 03:01:24 2023 UTC