ID: 48338 User updated by: bugreport at hotmail dot co dot uk Reported By: bugreport at hotmail dot co dot uk Status: Bogus Bug Type: Zip Related Operating System: CENTOS 5.2 i686 xen on server PHP Version: 5.2.9 New Comment:
Hi, thanks for your reply. Just run some more tests, turned out to be a problem with the Zip files I was receiving. These opened fine when downloaded and opened with Windows, but gave the results documented when opened on the server. I've since tried opening Zip files from different sources on the server which open fine. Previous Comments: ------------------------------------------------------------------------ [2009-05-19 23:01:18] [email protected] 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. ------------------------------------------------------------------------ [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
