From: killerbg at gmail dot com Operating system: Windows XP Professional SP3 PHP version: 5.2.8 PHP Bug Type: Zip Related Bug description: ZIP can not produce valid archive
Description: ------------ On Windows XP Professional Service Pack 3 with Apache 2.2.11 and PHP 5.2.8 - PHP 5.2.9 loaded as dynamic module when creating archive and adding files and/or folders the ouput is incorrect and the file gets corrupted. Even trying to open it again with the script results error code 19. Reproduce code: --------------- $file = tempnam("/tmp/", "php"); $zip = new ZipArchive(); if (($zip->open($file, ZipArchive::OVERWRITE)) === TRUE) { $zip->addEmptyDir("Directory"); $zip->addFile("File"); $zip->close(); } Expected result: ---------------- Correctly created zip archive file with unique name located in the temporaly directory. Actual result: -------------- Only the firsts few added files visible but corrupted acording to the crc32 record. -- Edit bug report at http://bugs.php.net/?id=46985&edit=1 -- Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=46985&r=trysnapshot52 Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=46985&r=trysnapshot53 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=46985&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=46985&r=fixedcvs Fixed in CVS and need be documented: http://bugs.php.net/fix.php?id=46985&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=46985&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=46985&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=46985&r=needscript Try newer version: http://bugs.php.net/fix.php?id=46985&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=46985&r=support Expected behavior: http://bugs.php.net/fix.php?id=46985&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=46985&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=46985&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=46985&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=46985&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=46985&r=dst IIS Stability: http://bugs.php.net/fix.php?id=46985&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=46985&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=46985&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=46985&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=46985&r=mysqlcfg