|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #20759 fopen sometimes hangs
Submitted: 2002-12-02 04:21 UTC Modified: 2002-12-15 04:06 UTC
From: mitra_php at mitra dot biz Assigned:
Status: Closed Package: HTTP related
PHP Version: 4.2.3 OS: Linux
Private report: No CVE-ID: None
 [2002-12-02 04:21 UTC] mitra_php at mitra dot biz
Sometimes fopen of an http URL just sits there - no error, no results, typically when it does this PHP refuses to output ANY output for that page. 

FOr example fopen("","r") works fine but


Just sits there for ever. 

Its possible that reptile is misbehaving, although this URL works fine in a browser, and in any case fopen shouldn't just sit there.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2002-12-02 04:24 UTC]
Please try using this CVS snapshot:
For Windows:

In PHP 4.3, there is a new ini setting which allows setting a default timeout.
Please try PHP-4.3.0RC2 from
Be sure to read the NEWS file for info about the timeout option. (the default is 60 seconds).
 [2002-12-02 05:07 UTC] mitra_php at mitra dot biz
Thanks for the suggestion, but the PHP timeout isn't the problem - its fopen that is hanging. It should fail allowing the script to handle the error gracefully (in my case moving on to the next URL). The PHP timeout only fails the whole PHP script if nothing happens in 60 seconds.
 [2002-12-02 05:09 UTC]
This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at
In case this was a documentation problem, the fix will show up soon at

In case this was a website problem, the change will show
up on the site and on the mirror sites in short time.
Thank you for the report, and for helping us make PHP better.

Try the PHP 4.3.0RC2 and check php.ini-dist, you will find this:

; Default timeout for socket based streams (seconds)
default_socket_timeout = 60

PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Wed May 18 20:04:39 2022 UTC