|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #30522 Unable to connect to addresses in the form of ""
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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
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
My code is supposed to read contents of a remote site into a string.

It works as expected when I use "" as the url, but when I use "" it gives an error.

Reproduce code:
list($protocol, $uri) = split('//', "");
$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


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2004-10-23 08:29 UTC]
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 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
instead of
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Wed Mar 22 22:03:41 2023 UTC