php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #36925 failed to open stream when trying to open remote file
Submitted: 2006-03-30 17:43 UTC Modified: 2006-04-10 00:05 UTC
Votes:4
Avg. Score:4.5 ± 0.9
Reproduced:3 of 3 (100.0%)
Same Version:1 (33.3%)
Same OS:3 (100.0%)
From: igor at oleinikov dot ru Assigned:
Status: Not a bug Package: Streams related
PHP Version: 5.1.2 OS: Windows XP SP2 Build 2600
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: igor at oleinikov dot ru
New email:
PHP Version: OS:

 

 [2006-03-30 17:43 UTC] igor at oleinikov dot ru
Description:
------------
When trying to open remote file via HTTP protocol, PHP produces warning:

failed to open stream: Resource temporarily unavailable

My Windows system have russian locale, so actualy I have localized error message, but this error is Socket error #10035 "Resource temporarily unavailable".

I have tested same code on FreeBSD system, and this error wasn't occuired.

PHP info:
System: Windows NT SCORP 5.1 build 2600
PHP API: 20041225
PHP Extension: 20050922
Zend Extension: 220051025
Debug Build: no
Thread Safety: enabled
Zend Memory Manager: enabled
IPv6 Support: enabled
Registered PHP Streams: php, file, http, ftp, compress.zlib, https, ftps
Registered Stream Socket Transports: tcp, udp, ssl, sslv3, sslv2, tls

allow_url_fopen: On
safe_mode: Off

Reproduce code:
---------------
$f = fopen('http://domain/file'); //series of real URLs and IP addresses was tried
$data = fread($f, 1024);
print $data;

Expected result:
----------------
data of file http://domain/file

Actual result:
--------------
Warning: fopen(http://domain/file) [function.fopen]: failed to open stream: Resource temporarily unavailable. in X:\Path\file.php on line 1

Warning: fread(): supplied argument is not a valid stream resource in X:\Path\file.php on line 2

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-03-30 17:48 UTC] igor at oleinikov dot ru
On PHP 5.1.1 this error occuires too.
 [2006-03-30 18:02 UTC] bjori@php.net
Do you get the error when using fopen() correctly?
 [2006-03-30 18:06 UTC] igor at oleinikov dot ru
Socket error #10035: Resource temporarily unavailable.

This error is returned from operations on nonblocking sockets that cannot be completed immediately.
 [2006-03-30 18:08 UTC] igor at oleinikov dot ru
I use: $f = fopen($url, 'r');
In first post I was make a misprint.
 [2006-03-30 21:43 UTC] tony2001@php.net
Disable windows firewall and make sure you are able to connect to this host with `telnet host.com 80`.
 [2006-03-30 23:20 UTC] igor at oleinikov dot ru
Windows Firewall is disabled. Any firewall is disabled.
And "telnet domain 80" connects to host successfuly.
I tryied to connect to localhost.
The error still keep occuiring.
 [2006-04-10 00:05 UTC] edink@php.net
There is something wrong with your setup. Just tested:

<?php
$f = fopen('http://www.php.net/index.php', 'r');
while (!feof($f)) {
	$data = fread($f, 1024);
	print $data;
}
?>

which produced the expected output.
 
PHP Copyright © 2001-2017 The PHP Group
All rights reserved.
Last updated: Sun Nov 19 01:31:42 2017 UTC