ID:               50953
 Updated by:       ahar...@php.net
 Reported By:      tony at marston-home dot demon dot co dot uk
-Status:           Bogus
+Status:           Open
 Bug Type:         Sockets related
 Operating System: Windows XP
 PHP Version:      5.2.12
 New Comment:

Reopening per discussion in bug #50965.


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

[2010-02-07 17:27:30] tony at marston-home dot demon dot co dot uk

I have tried that, but it still doesn't work.

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

[2010-02-07 17:15:21] paj...@php.net

Comment out the IPv6 entries for localhost (see the other bogus reports
for detailed explanations).

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

[2010-02-07 16:28:31] tony at marston-home dot demon dot co dot uk

Yes, but why should this make a difference? I have another Windows XP
PC running PHP 5.3.0 and that works OK. I have just upgraded this PC
from PHP 4.4.9 to 5.2.12, and it worked OK in PHP 4.

Is it something to do with the fact that IPV6 support is enabled in PHP
5.2.12 but disabled in PHP 5.3.0? Is this a PHP problem and not an OS
problem?

FYI my hosts file contains the following:

127.0.0.1       localhost
::1                             localhost
127.0.0.1       laptop
192.168.1.64    desktop

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

[2010-02-07 16:07:01] paj...@php.net

Did you install IPv6 support for XP?

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

[2010-02-07 13:31:42] tony at marston-home dot demon dot co dot uk

Description:
------------
If I use fsockopen with host 'localhost' it fails, but it works with
'127.0.0.1' or any other host name.

Reproduce code:
---------------
function connect($host) {
    $faultcode   = null;
    $faultstring = null;
    $conn = fsockopen($host, 80, $faultcode, $faultstring, 20);
    if (!$conn) {
        echo 'faultcode=' .$faultcode .', faultstring=' .$faultstring
."\n";
    } else {
        echo "Connected to $host OK\n";
    } // if
    return $conn;
} // function

$result = connect('localhost');
$result = connect('127.0.0.1');
$result = connect('desktop');
$result = connect('www.tonymarston.net');

Expected result:
----------------
I expect to see the message "Connected to <host> OK" for all values of
host.

Actual result:
--------------
Warning:  fsockopen(): unable to connect to localhost:80
faultcode=10060, faultstring=A connection attempt failed because the
connected party did not properly respond after a period of time, or
established connection failed because connected host has failed to
respond.

Connected to 127.0.0.1 OK
Connected to desktop OK
Connected to www.tonymarston.net OK



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


-- 
Edit this bug report at http://bugs.php.net/?id=50953&edit=1

Reply via email to