Problem Description
I have a problem when I install 'Archive_Zip 0.1.1' on the Linux server, but when I try to run the script to create the zip file it gives the fatal error
> Fatal error: Class `ZipArchive` not found in ...
where I put the code
$zip = new ZipArchive;
var_dump($zip);
$res = $zip->open($filename, ZipArchive::OVERWRITE);
if ($res !== TRUE) {
echo 'Error: Unable to create zip file';
exit;
}
if (is_file($src)) {
$zip->addFile($src);
} else {
// echo "<br>" . dirname(__FILE__) . $src;//'/install1';
if (!is_dir($src)) {
$zip->close();
@unlink($filename);
echo 'Error: File not found';
exit;
}
recurse_zip($src, $zip, $path_length);
}
$zip->close();
echo "<br>file name ".$filename;
but it doesn't find the class file.
Please tell me the solution. What should I do to resolve the problem?
I also put the `php.ini` file in the folder where the script is, but it does not work.
AI-Generated Solution
Powered by LMSouq AI · GPT-4.1-mini
Analyzing problem and generating solution…
Was this solution helpful?