ID: 48338 Updated by: j...@php.net Reported By: bugreport at hotmail dot co dot uk -Status: Open +Status: Bogus Bug Type: Zip Related Operating System: CENTOS 5.2 i686 xen on server PHP Version: 5.2.9 New Comment:
Works fine when your permissions are correct. Make sure the user as which your webserver runs as has permissions to write and execute to that path. Previous Comments: ------------------------------------------------------------------------ [2009-05-19 22:28:51] bugreport at hotmail dot co dot uk 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 this bug report at http://bugs.php.net/?id=48338&edit=1