From: bugreport at hotmail dot co dot uk Operating system: CENTOS 5.2 i686 xen on server PHP version: 5.2.9 PHP Bug Type: Zip Related Bug description: extractTo - unexpected results
Description: ------------ I am trying to unpack a Zip file. Permissions on both the Zip file and the destination directory (which is the same directory as the Zip file is in) are set to 0777. Running extractTo (zlib 1.2.3 installed) using code from example 1 at http://uk2.php.net/manual/en/function.ziparchive-extractto.php including $zip->extractTo('/path/...../'); results in no return to the browser (and the Zip file not being unpacked). Changing the above to $directory = '/path/...../'; $zip->extractTo('$directory'); results in " Warning: ZipArchive::extractTo() [ziparchive.extractto]: Permission denied in /path/....../script_file_name.php on line 12 " Again the Zip file is not unpacked. Reproduce code: --------------- <?php $zip = new ZipArchive; if ($zip->open('/path/...../xyz.zip') === TRUE) { $zip->extractTo('/path/...../'); $zip->close(); echo 'ok'; } else { echo 'failed'; } ?> Expected result: ---------------- Echo 'ok' (or 'failed') Zip file unpacked Actual result: -------------- Nothing returned to the browser. Zip file not unpacked. -- Edit bug report at http://bugs.php.net/?id=48338&edit=1 -- Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=48338&r=trysnapshot52 Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=48338&r=trysnapshot53 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=48338&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=48338&r=fixedcvs Fixed in CVS and need be documented: http://bugs.php.net/fix.php?id=48338&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=48338&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=48338&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=48338&r=needscript Try newer version: http://bugs.php.net/fix.php?id=48338&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=48338&r=support Expected behavior: http://bugs.php.net/fix.php?id=48338&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=48338&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=48338&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=48338&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=48338&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=48338&r=dst IIS Stability: http://bugs.php.net/fix.php?id=48338&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=48338&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=48338&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=48338&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=48338&r=mysqlcfg