|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #40881 file_get_contents with localhost on Vista
Submitted: 2007-03-21 11:22 UTC Modified: 2007-03-21 12:16 UTC
From: tkauk at t-online dot de Assigned:
Status: Not a bug Package: Streams related
PHP Version: 5.2.1 OS: Vista
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.
Block user comment
Status: Assign to:
Bug Type:
From: tkauk at t-online dot de
New email:
PHP Version: OS:


 [2007-03-21 11:22 UTC] tkauk at t-online dot de
file_get_contents fails to open a stream with an "http://localhost inside". 
Pinging or open the url via a browser works fine.
The same environment (apache, php.ini, etc.) works on XP.
Any ohter url not containing localhost(includung works fine.

Reproduce code:
$myUrl = "http://localhost/index.html";
//$myUrl = "";
if (!($cont=file_get_contents($myUrl))) {
  echo "<br/>error opening Url:" . $myUrl . " <br/>";
 else {
   echo "$cont";


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2007-03-21 12:16 UTC]
Not PHP problem.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Jul 16 07:01:31 2024 UTC