Cannot instantiate non-existent class: ziparchive
<p>I've a code that works correctly on test server but fails on live one (due to PHP version).</p>

<p>I'm getting this error:</p>

<p><code>Fatal error: Cannot instantiate non-existent class: ziparchive in /home/sites/www.example.com/web/zip.php on line 123</code></p>

<p>and the code is:</p>

<pre><code>$zip = new ZipArchive;
$zip-&gt;open($_FILES['uploadedfile']['tmp_name']);
$zip-&gt;extractTo('unzipped/' . $id . '/');
$zip-&gt;close();
</code></pre>

<p><strong>How to make it working without ZipArchive class being available?</strong></p>

<hr>

<p>Edit: I've used Mighty Google:</p>

<pre><code>&lt;?php
$zip = zip_open("zip.zip");
if ($zip) {
  while ($zip_entry = zip_read($zip)) {
    $fp = fopen("zip/".zip_entry_name($zip_entry), "w");
    if (zip_entry_open($zip, $zip_entry, "r")) {
      $buf = zip_entry_read($zip_entry, zip_entry_filesize($zip_entry));
      fwrite($fp,"$buf");
      zip_entry_close($zip_entry);
      fclose($fp);
    }
  }
  zip_close($zip);
}
?&gt;
</code></pre>

<p>Works great.</p>
