title: How to extract a ZIP file that has a password using only PHP?
body: <p>I have seen only one question on here but it does not answer my question. I am running a typical LAMP server that has the most up to date PHP 5 and MYSQL 5 with Redhat Linux.</p>
  
  <p>I need to find a PHP only solution because my host does not allow me to use shell.</p>
  
  <p>Here is my code that extracts ZIPs that are not passworded from vBulletin uploads to another directory:</p>
  
  <pre><code>if ($_GET['add'] == TRUE){
  $zip = new ZipArchive;
   $res = $zip-&gt;open($SOURCE FOLDER);
   if ($res === TRUE) {
       $zip-&gt;extractTo('$DESTINATION FOLDER/');
       $zip-&gt;close();
       echo 'File has been added to the library successfuly';
       //Add a flag to that file to indicate it has already been added to the library.
       mysql_query("UPDATE attachment SET library = 1 WHERE filedataid='$fileid'");    
   } else {
       echo 'A uncompression or file error has occured';
   }}
  </code></pre>
  
  <p>There must be some way to do this using just PHP, surely! Thank you.</p>
  
  <p>UPDATE: My host informs me that gzip is installed on the server but not 7-Zip. I am looking into shell access too.</p>