|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #23340 fopen on multiple urls from same server crashes
Submitted: 2003-04-25 04:05 UTC Modified: 2003-04-28 09:42 UTC
From: lucifer at vengeance dot et dot tudelft dot nl Assigned: wez (profile)
Status: Closed Package: HTTP related
PHP Version: 4CVS-2003-04-25 (stable) OS: Windows XP Pro
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
36 + 36 = ?
Subscribe to this entry?

 [2003-04-25 04:05 UTC] lucifer at vengeance dot et dot tudelft dot nl
this code causes a crash for me:


foreach($urls as $url) {
  $fp = fopen($url,"r");
  if($fp) fclose($fp);


1) it does not crash if i omit "if($fp) fclose($fp);"
2) the size of the url list needed for a crash could vary. for example, while above hosts resolve to the same IP, it also crashes for a list using different IPs; such a list for me had to be a couple of entries larger to crash.
3) i get a winxp "PHP Script Interpreter" crash dialog on the above code, though when working with bigger lists i occiasionally only got an Apache Internal Server error and no crash dialog

i tested this on 4.3.1 and 4.3.2-RC (2003-04-25)


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2003-04-25 04:10 UTC] lucifer at vengeance dot et dot tudelft dot nl
if its of any use, the winxp error signature:

szAppName : php.exe
szAppVer :
szModName : php4ts.dll     
szModVer :
offset : 000ae419
 [2003-04-25 12:11 UTC]
I get this output (run in linux, using cli):

Warning: fclose(): 6 is not a valid stream resource in /www/apache-1.3.27/htdocs/t.php on line 13
[Fri Apr 25 20:10:05 2003]  Script:  't.php'
/usr/src/web/php/php4/Zend/zend_execute.h(44) : Block 0x0876A6D8 status:
Beginning:      Cached (allocated on /usr/src/web/php/php4/Zend/zend_execute.c:1601, 12 bytes)
      End:      OK
/usr/src/web/php/php4/ext/standard/http_fopen_wrapper.c(292) :  Freeing 0x0876D284 (18 bytes), script=t.php

 [2003-04-28 09:42 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.

PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue May 21 13:01:36 2024 UTC