php.net |  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
 [2007-03-21 11:22 UTC] tkauk at t-online dot de
Description:
------------
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 127.0.0.1) works fine.



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


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-03-21 12:16 UTC] tony2001@php.net
Not PHP problem.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 12:01:27 2024 UTC