|  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
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
9 - 4 = ?
Subscribe to this entry?

 [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-2024 The PHP Group
All rights reserved.
Last updated: Thu Jun 13 09:01:34 2024 UTC