ID: 44065 Updated by: [EMAIL PROTECTED] Reported By: joe at digg dot com -Status: Open +Status: Feedback Bug Type: Streams related Operating System: Linux devwww25 2.6.12-1-amd64-k8 PHP Version: 5.2.5 New Comment:
Please try using this CVS snapshot: http://snaps.php.net/php5.2-latest.tar.gz For Windows (zip): http://snaps.php.net/win32/php5.2-win32-latest.zip For Windows (installer): http://snaps.php.net/win32/php5.2-win32-installer-latest.msi Seems to be fixed since I get this: ERROR: php_network_getaddresses: getaddrinfo failed: Name or service not known(#0) Note: The code is 0 always when failure happens before connect() (also mentioned in the friendly manual :) Previous Comments: ------------------------------------------------------------------------ [2008-02-07 01:12:40] [EMAIL PROTECTED] Hello, Got the same with 5.2.5 and 6 (32 bits machine) [EMAIL PROTECTED] bugs]# /usr/local/php6/bin/php fsockopen.php Warning: fsockopen(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /root/bugs/fsockopen.php on line 6 Warning: fsockopen(): unable to connect to www.asdf98070978.org:80 (Unknown error) in /root/bugs/fsockopen.php on line 6 ERROR: (#4) ------------------------------------------------------------------------ [2008-02-07 00:48:42] joe at digg dot com Did you run the reproduce code? I can consistently reproduce no error and warnings being thrown from many machines. What was the output when you ran the code below? Though, depending on the machine, I sometimes get an error code. ------------------------------------------------------------------------ [2008-02-07 00:44:42] [EMAIL PROTECTED] Hello, I have not been able to reproduce it. Can please give us an extra explanation about it? ------------------------------------------------------------------------ [2008-02-06 22:37:42] joe at digg dot com Description: ------------ When getaddrinfo fails fsockopen() fails to return an error string or error code. Reproduce code: --------------- <?php $code = 0; $message = ''; $fp = fsockopen('www.asdf98070978.org', 80, $code, $message); if (!is_resource($fp)) { echo 'ERROR: ' . $message . '(#' . $code . ')' . "\n"; } else { echo 'Connected!' . "\n"; fclose($fp); } ?> Expected result: ---------------- fsockopen() should return false and set an appropriate error code and error message. Actual result: -------------- It spits out a warning and doesn't include any sort of error message or string: Warning: fsockopen(): php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution in /home/jstump/repository/wildcat/branches/config/foo.php on line 5 Warning: fsockopen(): unable to connect to www.asdf98070978.org:80 (Unknown error) in /home/jstump/repository/wildcat/branches/config/foo.php on line 5 ERROR: (#0) ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=44065&edit=1