From: kianhuay at pacific dot net dot sg Operating system: Windows PHP version: 5.0.2 PHP Bug Type: HTTP related Bug description: Unable to connect to addresses in the form of "http://www.site.com/xxx.html"
Description: ------------ My code is supposed to read contents of a remote site into a string. It works as expected when I use "http://www.site.com" as the url, but when I use "http://www.site.com/xxx.html" it gives an error. Reproduce code: --------------- list($protocol, $uri) = split('//', "http://www.site.com/xxx.html"); $html = file_get_contents($protocol . '//' . urlencode($uri)); echo $html; Expected result: ---------------- I expect to read the contents of the remote site into a string, but I get an error instead: Warning: file_get_contents() [function.file-get-contents]: php_network_getaddresses: getaddrinfo failed: No such host is known. in C:\Program Files\Apache Group\Apache2\htdocs\index.php on line 14 -- Edit bug report at http://bugs.php.net/?id=30522&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=30522&r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=30522&r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=30522&r=trysnapshot51 Fixed in CVS: http://bugs.php.net/fix.php?id=30522&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=30522&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=30522&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=30522&r=needscript Try newer version: http://bugs.php.net/fix.php?id=30522&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=30522&r=support Expected behavior: http://bugs.php.net/fix.php?id=30522&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=30522&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=30522&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=30522&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=30522&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=30522&r=dst IIS Stability: http://bugs.php.net/fix.php?id=30522&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=30522&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=30522&r=float MySQL Configuration Error: http://bugs.php.net/fix.php?id=30522&r=mysqlcfg