You need to upgrade server php version, ZipArchive will not work with php 5.2.
ZipArchive is not working on server php
Pergunta
I am using code for unzip a file on server, but its not working, I want to unzip the zip file myfolder.zip on server. Code which I am using is :
<?php error_reporting(E_ALL);
set_time_limit(0);
$zip = new ZipArchive;
$res = $zip->open('myfolder.zip');
if ($res === TRUE) {
$zip->extractTo('./');
$zip->close();
echo 'done!';
} else {
echo 'not done!';
}
?>
Is there anything wrong ?
Solução
Outras dicas
Your code seems to be fine, however Even i had faced a similar issue, increasing the memory limit directive in my php.ini
fixed the issue for me.
you could find memory_limit
directive, increase it and restart your web server and try to execute your code.
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow