#40287 [NEW]: Opening stream to 'localhost' fails
| From: | torarnek at pvv dot org | Date: | Tue, 30 Jan 2007 13:42:12 +0000 |
| Subject: | #40287 [NEW]: Opening stream to 'localhost' fails | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-108236@lists.php.net to get a copy of this message | ||
From: torarnek at pvv dot org
Operating system: Windows Vista
PHP version: 5.2.0
PHP Bug Type: Streams related
Bug description: Opening stream to 'localhost' fails
Description:
------------
When opening a stream to a file in an apache server running locally, using
an url with 'localhost' to refer the local host, it times out with an error
message.
However, using 127.0.0.1 to refer the localhost works.
I searched the web and found a reference to the issue:
Title: Binding to localhost throws exception in
http://msdn2.microsoft.com/en-us/vstudio/aa972193.aspx
Reproduce code:
---------------
$url = "http://localhost/scoop/www/test2.html";
$fil = fopen($url, 'r');
if ($fil) {
while(!feof($fil)) {
echo fgets($fil);
}
fclose($fil);
}
Expected result:
----------------
Should return a stream to the file.
Actual result:
--------------
Warning: fopen(http://localhost/scoop/www/test2.html) [function.fopen]:
failed to open stream: A connection attempt failed because the connected
party did not properly respond after a period of time, or established
connection failed because connected host has failed to respond. in
E:\workspace\scoop\Scoop\www\test.php on line 6
Fatal error: Maximum execution time of 30 seconds exceeded in
E:\workspace\scoop\Scoop\www\test.php on line 6
--
Edit bug report at http://bugs.php.net/?id=40287&edit=1
--
Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=40287&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=40287&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=40287&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=40287&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=40287&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=40287&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=40287&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=40287&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=40287&r=support
Expected behavior: http://bugs.php.net/fix.php?id=40287&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=40287&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=40287&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=40287&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=40287&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=40287&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=40287&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=40287&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=40287&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=40287&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=40287&r=mysqlcfg