|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #26060 Not closing download handles
Submitted: 2003-10-31 12:42 UTC Modified: 2003-11-25 15:32 UTC
Avg. Score:5.0 ± 0.0
Reproduced:2 of 2 (100.0%)
Same Version:1 (50.0%)
Same OS:1 (50.0%)
From: datacompboy at mail dot ru Assigned:
Status: No Feedback Package: cURL related
PHP Version: 4.3.3 OS: Win2003 adv server
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.
Block user comment
Status: Assign to:
Bug Type:
From: datacompboy at mail dot ru
New email:
PHP Version: OS:


 [2003-10-31 12:42 UTC] datacompboy at mail dot ru
I tried to download file with curl, parse it with external app, show output and kill temp file. But:
1. if php as isapi module - when several requests at one time some inputs are locked! Filemon says that it frees by some cmd.exe after all runned sub-processes already finished. Very strange!
2. if php as fastcgi - it often crashes with error in php_curl (all latest dlls in system32 upgraded; php4ts only in c:\php, php4isapi also in c:\php and no in c:\windows\system)
3. if php as cgi - all OK, except of when user cancelled download the script terminated, but shotdown_procedure not called, so temp files left.

Reproduce code:
<?ob_start(); $url="";
  $oinfile = tempnam ("./", "URLIN");
  $infile = preg_replace("#.*[/\\\\](.*?)#","\$1",$oinfile);
  $ooutfile = tempnam ("./", "URLOU");
  $outfile = preg_replace("#.*[/\\\\](.*?)#","\$1",$ooutfile);
    "@unlink(\"$infile\"); @unlink(\"$outfile\"); @unlink(\"$oinfile\"); @unlink(\"$ooutfile\"); return 1;"));
  $inf = fopen($infile, "w");
  fwrite($inf, "<meta http-equiv=\"Content-Type\" content=\"text/html\">\n");
  $ch = curl_init();
  curl_setopt ($ch, CURLOPT_URL, $url);
  curl_setopt ($ch, CURLOPT_FILE, $inf);
  $st=curl_exec ($ch);
  curl_close ($ch);
  echo `filter.exe $lang $infile $outfile 2>&1`;

Expected result:
No .tmp files not in windows\temp\ folder, not in script folder.

Actual result:
Some .tmp files left and in windows\temp, and in script folder.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2003-11-17 22:52 UTC]
Maybe I didn't make it clear enough so let's try again:

Please provide a SHORT (max 20 lines) and complete example script preferrably one that can be run on command line (using PHP CLI)

 [2003-11-25 15:32 UTC]
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.

PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Tue May 30 10:03:42 2023 UTC