|   | php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
| 
 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits              [2009-07-06 13:21 UTC] pajoye@php.net
  [2009-07-06 14:37 UTC] mb at smartftp dot com
  [2010-06-21 10:28 UTC] pajoye@php.net
 
-Type:        Bug
+Type:        Feature/Change Request
-PHP Version: 5.*, 6CVS (2009-05-10)
+PHP Version: *
  [2010-06-21 10:28 UTC] pajoye@php.net
  [2017-10-24 07:31 UTC] kalle@php.net
 
-Status:      Assigned
+Status:      Open
-Assigned To: pajoye
+Assigned To:
  [2018-02-15 11:30 UTC] mmi at uhb-consulting dot de
  [2021-07-02 15:44 UTC] cmb@php.net
 
-Status:      Open
+Status:      Closed
-Assigned To:
+Assigned To: cmb
  [2021-07-02 15:44 UTC] cmb@php.net
 | |||||||||||||||||||||||||||||||||||||
|  Copyright © 2001-2025 The PHP Group All rights reserved. | Last updated: Fri Oct 31 23:00:01 2025 UTC | 
Description: ------------ The ZIPArchive->open fails with error 11 when a zip file is opened that has just been created using ZIPArchive. The test code works as expected when running it under administrative privileges. However when running it under restricted access privileges the ZIPArchive->open function is unable to open the file. On the other side readfile() can successfully open the same file. My guess is that the ZipArchive->open functions tries to open the file using a mode other than just read. Reproduce code: --------------- <?php $file = tempnam(sys_get_temp_dir(), 'zip'); print($file . "\n"); $create = new ZipArchive; if($create->open($file, ZIPARCHIVE::CREATE | ZIPARCHIVE::OVERWRITE )) { for($i=0; $i<10; $i++) { $bogus = "fjewklfj23klfj23lkfj23l"; $create->addFromString($i, $bogus); } if(!$create->close()) { print("close failed"); } } $zip = new ZipArchive(); $open = $zip->open($file); if($open === TRUE) { print("ok\n"); } else { print("error ".$open."\n"); readfile($file); } Expected result: ---------------- ok Actual result: -------------- error 11. content of zip file.