#40881 [Opn->Bgs]: file_get_contents with localhost on Vista
| From: | tony2001@php.net | Date: | Wed, 21 Mar 2007 12:16:35 +0000 |
| Subject: | #40881 [Opn->Bgs]: file_get_contents with localhost on Vista | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-110643@lists.php.net to get a copy of this message | ||
ID: 40881
Updated by: tony2001@php.net
Reported By: tkauk at t-online dot de
-Status: Open
+Status: Bogus
Bug Type: Streams related
Operating System: Vista
PHP Version: 5.2.1
New Comment:
Not PHP problem.
Previous Comments:
------------------------------------------------------------------------
[2007-03-21 11:22:27] 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";
}
?>
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=40881&edit=1