#30522 [Opn->Bgs]: Unable to connect to addresses in the form of "http://www.site.com/xxx.html"
| From: | tony2001@php.net | Date: | Sat, 23 Oct 2004 06:29:19 +0000 |
| Subject: | #30522 [Opn->Bgs]: Unable to connect to addresses in the form of "http://www.site.com/xxx.html" | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-67976@lists.php.net to get a copy of this message | ||
ID: 30522
Updated by: tony2001@php.net
Reported By: kianhuay at pacific dot net dot sg
-Status: Open
+Status: Bogus
Bug Type: HTTP related
Operating System: Windows
PHP Version: 5.0.2
New Comment:
Sorry, but your problem does not imply a bug in PHP itself. For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system
is not the
appropriate forum for asking support questions.
Thank you for your interest in PHP.
Not a bug - you're trying to get
http://www.site.com%2Fxxx.html
instead of
http://www.site.com/xxx.html
Previous Comments:
------------------------------------------------------------------------
[2004-10-21 22:47:23] kianhuay at pacific dot net dot sg
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 this bug report at http://bugs.php.net/?id=30522&edit=1