ID: 50214 Updated by: j...@php.net Reported By: phil at lavin dot me dot uk -Status: Open +Status: Feedback Bug Type: Sockets related Operating System: Linux 2.6.30 PHP Version: 5.2.11 New Comment:
# sapi/cli/php -r 'var_dump(fsockopen("[2610:1e8:2900:a::8]", 6667));' Warning: fsockopen(): unable to connect to [2610:1e8:2900:a::8]:6667 (Network is unreachable) ..so I'd say your system is either misconfigured or missing ipv6 support or the target is not there. :) Previous Comments: ------------------------------------------------------------------------ [2009-11-18 14:37:10] phil at lavin dot me dot uk The grep output in the original bug report is of a phpinfo. It is 'enabled' Phil ------------------------------------------------------------------------ [2009-11-18 14:28:37] j...@php.net Was PHP compiled properly? ie. did you enable ipv6 support? (check phpinfo() output for 'IPv6 Support'. ------------------------------------------------------------------------ [2009-11-18 10:08:29] phil at lavin dot me dot uk Description: ------------ When connecting to an IPv6 address, either hostname or raw address in [] an 'unknown error' is thrown. This problem occurs on both Linux and BSD and both test machines can correctly telnet to the requested address. p...@127dot0dot0dot1:~$ php info.php | grep -i ipv6 IPv6 Support => enabled p...@127dot0dot0dot1:~$ Reproduce code: --------------- <?php $a = fsockopen('[2610:1e8:2900:a::8]', 6667); if ($a) { echo 'yay'; } else { echo 'nay'; } ?> Expected result: ---------------- The code should echo 'yay'. Actual result: -------------- Warning: fsockopen(): unable to connect to [2610:1e8:2900:a::8]:6667 (Unknown error) in /root/test.php on line 2 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=50214&edit=1