ID: 39231 User updated by: lajbr at seznam dot cz Reported By: lajbr at seznam dot cz Status: Bogus Bug Type: Unknown/Other Function Operating System: Windows 2003 Server PHP Version: 5.1.6 Assigned To: pajoye New Comment:
Thank you for your help. We found a mistake in our side but this behaviour of PHP is very strange. We have missing extension of the file and PHP 5.0.5 probably automatically added correct extension to the filename internally. PHP 5.2.0, 5.1.6 and 5.1.4 returns this Warning in another zip functions. It's very interesting that according to the manual function zip_open() have to return false when file doesn't exist or resource id. In the fact (from PHP 5.1.4 and above) if file doesn't exist then function zip_open()returns 11, returns 19 if it isn't Zip file and resource id in other cases. This is strange behaviour because everybody expects that zip_open() returns false when whichever error occures. Previous Comments: ------------------------------------------------------------------------ [2006-10-23 14:11:59] [EMAIL PROTECTED] You are doing something wrong in your script. I tried using 5.1.6, 5.2.0, 6.0 and with the latest pecl4win dll using this script: $zipfile = 'bug39231.zip'; if ($sourcezip = zip_open($zipfile)) { while ($zip_entry = zip_read($sourcezip)) { echo 'filename: '. zip_entry_name($zip_entry) . " "; echo 'filesize: '. zip_entry_filesize($zip_entry) . "\n"; } zip_close($sourcezip); } else { echo "Cannot open zip"; } C:\php-5.1.6>php.exe bug39231.php filename: result.htm filesize: 55457 filename: test.zip filesize: 131347 filename: ziptest.php filesize: 599 It works like a charm (and as expected). Be sure to load the correct php_zip.dll or to have restarted your server after a dll update. ------------------------------------------------------------------------ [2006-10-23 13:47:49] lajbr at seznam dot cz Try to look at http://ambruz.webz.cz/problem.zip Inside this zip are stored: * ziptest.php ... script with phpinfo and tested function * test.zip ... problem Zip file * result.htm ... output with Warning messages and output of phpinfo. I tried the latest files from pecl too but without effect. ------------------------------------------------------------------------ [2006-10-23 12:49:53] [EMAIL PROTECTED] I still need a Zip file to reproduce your problem. ------------------------------------------------------------------------ [2006-10-23 12:46:12] lajbr at seznam dot cz I tried to use the latest snapshot from mentioned link but with the same result. In PHP 5.2-latest there is the same problem like in PHP 5.1.6 and 5.1.4. ------------------------------------------------------------------------ [2006-10-23 12:39:09] [EMAIL PROTECTED] Also which Zip extension do you use? (See phpinfo, $id and version). If the problem persists with 5.2.0 or a recent version (get the latest DLLs on http://pecl4win.php.net), please provide a link to the zip file you use in this test. ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/39231 -- Edit this bug report at http://bugs.php.net/?id=39231&edit=1