Need help with Zippy?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

453 Stars 82 Forks Other 438 Commits 42 Opened issues


PHP zip/tar/bz2 archives (de)compression library with commandline or extensions

Services available


Need anything else?

Contributors list


License Packagist Travis Scrutinizer Packagist

A PHP library to read, create, and extract archives in various formats via command line utilities or PHP extensions


The only supported installation method is via Composer. Run the following command to require Zippy in your project:

composer require alchemy/zippy


Zippy currently supports the following drivers and file formats:

  • zip
    • .zip
  • PHP zip extension
    • .zip
  • GNU tar
    • .tar
    • .tar.gz
    • .tar.bz2
  • BSD tar
    • .tar
    • .tar.gz
    • .tar.bz2

Getting started

All the following code samples assume that Zippy is loaded and available as

. You need the following code (or variation of) to load Zippy:
// Require Composer's autoloader
require DIR . '/vendor/autoload.php';

// Load Zippy $zippy = Zippy::load();

List an archive's contents:

// Open an archive
$archive = $zippy->open('build.tar');

// Iterate through members foreach ($archive as $member) { echo "Archive contains $member" . PHP_EOL; }

Extract an archive to a specific directory:

// Open an archive
$archive = $zippy->open('build.tar');

// Extract archive contents to /tmp $archive->extract('/tmp');

Create a new archive

// Creates an that contains a directory "folder" that contains
// files contained in "/path/to/directory" recursively
$archive = $zippy->create('', array(
    'folder' => '/path/to/directory'
), true);

Customize file and directory names inside archive

$archive = $zippy->create('', array(
    'folder' => '/path/to/directory',            // will create a folder at root
    '',            // will create a logo.jpg file at root
    fopen(''), // will create an index.php at root
    'directory/image.jpg' => 'image.jpg',        // will create a image.jpg in 'directory' folder


Documentation hosted at read the docs !


This project is licensed under the MIT license.

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.