From: ogi at triangle dot bg
Operating system: Windows XP Pro SP3
PHP version: 5.2.9RC2
PHP Bug Type: Sockets related
Bug description: fsockopen doesn't work with DNS names, only IPs
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 bug report at http://bugs.php.net/?id=47437&edit=1
--
Try a CVS snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=47437&r=trysnapshot52
Try a CVS snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=47437&r=trysnapshot53
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=47437&r=trysnapshot60
Fixed in CVS:
http://bugs.php.net/fix.php?id=47437&r=fixedcvs
Fixed in CVS and need be documented:
http://bugs.php.net/fix.php?id=47437&r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=47437&r=alreadyfixed
Need backtrace:
http://bugs.php.net/fix.php?id=47437&r=needtrace
Need Reproduce Script:
http://bugs.php.net/fix.php?id=47437&r=needscript
Try newer version:
http://bugs.php.net/fix.php?id=47437&r=oldversion
Not developer issue:
http://bugs.php.net/fix.php?id=47437&r=support
Expected behavior:
http://bugs.php.net/fix.php?id=47437&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=47437&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=47437&r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=47437&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=47437&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=47437&r=dst
IIS Stability:
http://bugs.php.net/fix.php?id=47437&r=isapi
Install GNU Sed:
http://bugs.php.net/fix.php?id=47437&r=gnused
Floating point limitations:
http://bugs.php.net/fix.php?id=47437&r=float
No Zend Extensions:
http://bugs.php.net/fix.php?id=47437&r=nozend
MySQL Configuration Error:
http://bugs.php.net/fix.php?id=47437&r=mysqlcfg