php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #30522 Unable to connect to addresses in the form of "http://www.site.com/xxx.html"
Submitted: 2004-10-21 22:47 UTC Modified: 2004-10-23 08:29 UTC
From: kianhuay at pacific dot net dot sg Assigned:
Status: Not a bug Package: HTTP related
PHP Version: 5.0.2 OS: Windows
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: kianhuay at pacific dot net dot sg
New email:
PHP Version: OS:

 

 [2004-10-21 22:47 UTC] 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


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-10-23 08:29 UTC] tony2001@php.net
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
 
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Wed Jan 19 20:03:14 2022 UTC