|  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
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:
36 - 24 = ?
Subscribe to this entry?

 [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-2023 The PHP Group
All rights reserved.
Last updated: Tue Nov 28 16:01:27 2023 UTC