php.net |  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
Votes:3
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
 [2008-11-22 16:50 UTC] carrerag at hotmail dot com
Description:
------------
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:
---------------
<?php
echo gethostbyaddr ( '2001:470:0:64::2' );
?>

Expected result:
----------------
Return "ipv6.he.net"

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

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-11-23 20:46 UTC] lbarnaud@php.net
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 php.net 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] pajoye@php.net
Only 5.3+ will have new features for Windows.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Nov 24 22:01:33 2024 UTC