Class 'ZipArchive' not found: install it as non-root?
<p>I am trying to implement a simple script that ZIPs up a text file but ZIPArchive() is not available on my server. Here is an example of my code:</p>

<pre><code>&lt;?php
$zip = new ZipArchive();
$filename = "./PJR.v2.zip";
if ($zip-&gt;open($filename, ZIPARCHIVE::CREATE)!==TRUE) {
    exit("cannot open &lt;$filename&gt;\n");
}
if ($handle = opendir('WORKDIR')) {
    while (false !== ($entry = readdir($handle))) {
        if ($entry != "." &amp;&amp; $entry != "..") {
        $zip-&gt;addFile($entry);
        }
    }
  closedir($handle);
}
$zip-&gt;close();
?&gt;
</code></pre>

<p>When I run it from the command line, I get </p>

<pre><code>PHP Fatal error:  Class 'ZipArchive' not found in /users/albert/zip_POC.v2.php on line 2
</code></pre>

<p>This is the version info on my server: </p>

<pre><code>php -v
PHP 5.1.6 (cli) (built: Nov 12 2008 11:22:53)
Copyright (c) 1997-2006 The PHP Group
Zend Engine v2.1.0, Copyright (c) 1998-2006 Zend Technologies
</code></pre>

<p>Is there a way that I can install that class even though I am not the 'root' user??</p>

<p><strong>EDIT</strong>:</p>

<p>PHP was not compiled on my server with ZIP support. The <code>configure command</code> section of PhpInfo() does not show the --enable-zip option. PECL is not installed either so I cannot workaround my problem with <code>pecl install zip</code> either. </p>
