I’m trying to extact a zip folder in php, I’m using ZipArchive for do that but it doesn’t work.
I check the permission and it’s ok
I also check the destination and it’s ok too
$zip = new ZipArchive();
if ($zip->open($pathShapeFile, ZipArchive::CREATE | ZIPARCHIVE::OVERWRITE)) {
var_dump($zip);
$path = pathinfo($pathShapeFile);
$path_tmp = $path['dirname'] . DS . $path['filename'] . '_dezip';
if(!is_dir($path_tmp)) {
mkdir($path_tmp);
chmod($path_tmp, 0777);
}
$extract = $zip->extractTo($path_tmp);
}
The folder of destination is created by it’s empty
$extract return object(ZipArchive)#515 (5) { [“status”]=> int(0) [“statusSys”]=> int(0) [“numFiles”]=> int(0) [“filename”]=> string(50) “/srv/files/shape/Dossier514.zip.zip” [“comment”]=> string(0) “” } and this line “$zip->open($pathShapeFile, ZipArchive::CREATE | ZIPARCHIVE::OVERWRITE)” return true