php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #63711 inet_pton not working with IPv6 on Windows
Submitted: 2012-12-06 14:43 UTC Modified: 2013-01-23 15:17 UTC
From: Pavel dot Srubar at gmail dot com Assigned:
Status: Not a bug Package: Documentation problem
PHP Version: 5.4.9 OS: MS Windows XP SP3
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: Pavel dot Srubar at gmail dot com
New email:
PHP Version: OS:

 

 [2012-12-06 14:43 UTC] Pavel dot Srubar at gmail dot com
Description:
------------
---
From manual page: http://www.php.net/function.inet-pton#refsect1-function.inet-
pton-changelog
---
Changelog of inet_pton() says
"5.3.0	 This function is now available on Windows platforms."
and install requirements at http://php.net/manual/en/network.installation.php
"There is no installation needed to use these functions; they are part of the PHP 
core."

however the function does not recognize IPv6 addresses on my Windows XP SP3.


Test script:
---------------
<?php echo phpversion(); if (defined('AF_INET6')) echo "\r\nAF_INET6 defined. ";
echo "\r\n".inet_ntop(inet_pton('127.0.0.1'));
echo "\r\n".inet_ntop(inet_pton('::1'));
?>

Expected result:
----------------
5.4.0
AF_INET6 defined. 
127.0.0.1
::1


Actual result:
--------------
5.4.0
AF_INET6 defined. 
127.0.0.1

Warning:  inet_pton(): Unrecognized address ::1 

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-01-23 15:17 UTC] googleguy@php.net
This works fine for me on Windows 7 using PHP 5.3 built with IPv6 Support.

Check your phpinfo() to confirm that your PHP was built with IPv6 support. If it 
does not work as expected please open a code bug for this function. There is no 
documentation bug here.
 [2013-01-23 15:17 UTC] googleguy@php.net
-Status: Open +Status: Not a bug
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Thu Oct 08 01:00:01 2026 UTC