#50965 [Bgs]: fsockopen will not work on 'localhost'
| From: | aharvey@php.net | Date: | Mon, 08 Feb 2010 11:18:19 +0000 |
| Subject: | #50965 [Bgs]: fsockopen will not work on 'localhost' | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-147318@lists.php.net to get a copy of this message | ||
ID: 50965
Updated by: aharvey@php.net
Reported By: tony at marston-home dot demon dot co dot uk
Status: Bogus
Bug Type: Sockets related
Operating System: Windows XP
PHP Version: 5.2.12
New Comment:
Correction: bug #50953 isn't open. That still doesn't merit opening a
new one, IMO.
Previous Comments:
------------------------------------------------------------------------
[2010-02-08 11:16:33] aharvey@php.net
Please don't open duplicate bugs in an attempt to "bump" existing open
bugs. It's been less than 19 hours since your last post in bug #50953;
I'm quite sure Pierre will respond when he's able.
Closing.
------------------------------------------------------------------------
[2010-02-08 11:06:37] tony at marston-home dot demon dot co dot uk
Description:
------------
When are you going to provide a proper answer for post
http://bugs.php.net/bug.php?id=50953 ? I have
removed the IPv6 entries
in my hosts file, but the problem is still there.
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=50965&edit=1