Bugsalert.com
Security News about Viruses, Spyware,
Trojans, Malware, XSS attacks.

fsockopen will not work on 'localhost'

BugsAlert Home > fsockopen will not work on 'localhost'
 
 

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 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




Original Source: http://bugs.php.net/50953

Learn more about fsockopen will not work on 'localhost'
 
Tags: fsockopen work localhost

Related Items

      Mandriva: kernel

      CVE-2008-6321 (cf_shopkart)

      CVE-2008-5646 (trac)

      Configuration problem

      Meeting Notes from the Mozilla community: Places Meeting Minutes: 2009-02-09

      CVE-2008-6863 (absolute_form_processor.net)

      SuSE Security Update Fixes CUPS Multiple Buffer Overflow Vulnerabilities

 

Pixel