|  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
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: 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: Sat Mar 02 08:01:29 2024 UTC