ID:               47437
 User updated by:  ogi at triangle dot bg
 Reported By:      ogi at triangle dot bg
-Status:           Feedback
+Status:           Open
 Bug Type:         Sockets related
 Operating System: Windows XP Pro SP3
 PHP Version:      5.2.9RC2
 Assigned To:      pajoye
 New Comment:

C:\WINDOWS\system32\drivers\etc\hosts contains

127.0.0.1       localhost

and other entries are irrelevant to this case.

This happened after some Drupal updates but I can't see how this can
influence PHP itself - the above PHP example is isolated from Drupal
framework.


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

[2009-02-18 17:03:53] paj...@php.net

Can you check that you do not have IPv6 enabled (it is not in xp Pro
afaict)? I think it is enabled and your host file should have a line
like:

::1 locahost ..other hosts...

comment it out and be sure that the ipv4 127.0.0.1 aliases are in
place.

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

[2009-02-18 17:00:27] ogi at triangle dot bg

'localhost' and system host names (both short host name and FQDN)
behave like already described. I've just found out that other host names
that are not the local system work fine.

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

[2009-02-18 16:02:13] paj...@php.net

Any hostname or only localhost?

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

[2009-02-18 14:55:18] ogi at triangle dot bg

Description:
------------
Any DNS name passed to fsockopen is not recognized. Everything in the
system works fine with DNS names - Firefox, nslookup command-line
utility, DNS Client service is started. If it matters, PHP is installed
as module in Apache 2.2.10.


Reproduce code:
---------------
var_dump(fsockopen(gethostbyname('localhost'), 80));
var_dump(fsockopen('localhost', 80));


Expected result:
----------------
resource(2) of type (stream)
resource(3) of type (stream)


Actual result:
--------------
resource(2) of type (stream)
Warning: fsockopen() [function.fsockopen]: unable to connect to
localhost:80 (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. ) in
C:\Program Files\drupal\i.php on line 4
bool(false)


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


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

Reply via email to