title: PHP extracting files from zip issues with copy
body: <p>I am trying to extract file from a zip via PHP, I have some working code, but when I move it from one server to another it all of sudden stopped working :( In this code, it creates folders, I can see its doing that, but the files in the zip are not being extracted :(</p>
  
  <p>Here is my code:</p>
  
  <pre><code>if($_FILES['url']['error'] == 0){
      system('rm -rf ../images/galleries/' . $galleryName);
      $filename = $_FILES["url"]["name"];
      $source = $_FILES["url"]["tmp_name"];
      $type = $_FILES["url"]["type"];
      $name = explode(".", $filename);
      $accepted_types = array('application/zip', 'application/x-zip-compressed', 'multipart/x-zip', 'application/x-compressed');
  
      foreach($accepted_types as $mime_type) {
          if($mime_type == $type) {
              $okay = true;
              break;
          }
      }
  
      $continue = strtolower($name[1]) == 'zip' ? true : false;
  
      if (!file_exists('../images/galleries/' . $galleryName)) {
          mkdir('../images/galleries/' . $galleryName, 0777, true);
      }
      $target_path = '../images/galleries/' . $galleryName . '/' . $filename;
      $image = $filename;
  
      if(move_uploaded_file($source, $target_path)) {
          $path = $target_path;
          $zip = new ZipArchive();
          if ($zip-&gt;open($path) === true) {
              for($i = 0; $i &lt; $zip-&gt;numFiles; $i++) {
                  $filename = $zip-&gt;getNameIndex($i);
                  $fileinfo = pathinfo($filename);
                  $imagePreFix = substr($fileinfo['basename'], 0, strpos($fileinfo['basename'], "_")) . '_';
                  copy("zip://".$path."#".$filename, '../images/galleries/' . $galleryName . '/' . $fileinfo['basename']);
                  chmod('../images/galleries/' . $galleryName . '/' . $fileinfo['basename'], 0777);
              }
              $zip-&gt;close();
          }
      }
      unlink($path);
      $galleryClass-&gt;insertImage($connection, $_POST['galleryId'], $image, $_POST['link'], $_POST['order']);
  }
  </code></pre>
  
  <p>I think the issue is with this:</p>
  
  <pre><code>copy("zip://".$path."#".$filename, '../images/galleries/' . $galleryName . '/' . $fileinfo['basename']);
  </code></pre>
  
  <p>is there another way to do this or is this a server problem?</p>