Results 1 to 5 of 5

Thread: php can't close the $zip

Threaded View

  1. #1
    Join Date
    Dec 2006

    php can't close the $zip

    Not clear what still needs doing.

    I have this small bundle of php (zipTest.php)...
    PHP Code:
    =new ZipArchive();
    if (
    $zip->open($zipnameZipArchive::CREATE) !== TRUE) {die ('Could not open archive');}
    foreach (
    $files as $file) {$zip->addFile($file) or die ('Could not add file');}
    $zip->close() or die ('<br>Could not close file');
    ?> a virtually / locally hosted domain in my /home/directory....

    Both /home/directory (drwxrwxr-x 2 homeUser homeUser) and zipTest.php (-rw-rw-r-- 1 homeUser homeUser) seem to have the requisite reads and writes in place to allow the file to be built and written to the /home/directory (by the homeUser).

    When I access zipTest.php via the browser (as homeUser), this is what appears...
    Could not close file
    ...showing (it seems) that the ZipArchive is created, three files (a, b and c) are added to it (numFiles:3) and that all is so far so good (status:0) - until zipTest.php fails to close (finish creating)!

    Thanks for any suggestions.

    NB: I have also "777'ed" both the directory and php file, which I thought might address potential www-data / apache permissions issues - with the same results.
    Last edited by maclenin; May 15th, 2013 at 04:00 PM.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts