When users want to unzip files on my PHP site(hosting uses Ubuntu 16.04), it works for Linux or MAC users, but does not work for Windows users and just upload zip file without unpacking. I used these solutions:
echo exec("unzip $file_name ",$result, $returnval );
or
$zip = new ZipArchive;
$res = $zip->open($file_name);
$zip->extractTo($dir);
$zip->close();
and also tested PclZip library
$archive = new PclZip($file_name);
$result = $archive->extract(PCLZIP_OPT_PATH, $dir);