Jump to content

[SOLVED] Zip Issue


magebash

Recommended Posts

Ok I get this error:

Fatal error: Class 'ZipArchive' not found in /home/www/possal.freehostia.com/backup.php on line 3

When I use this code from php.net:

<?php

$zip = new ZipArchive();
$filename = "backup.zip";

if ($zip->open($filename, ZIPARCHIVE::CREATE)!==TRUE) {
    exit("cannot open <$filename>\n");
}

$zip->addFromString("testfilephp.txt" . time(), "#1 This is a test string added as testfilephp.txt.\n");
$zip->addFromString("testfilephp2.txt" . time(), "#2 This is a test string added as testfilephp2.txt.\n");
$zip->addFile($thisdir . "/too.php","/testfromfile.php");
echo "numfiles: " . $zip->numFiles . "\n";
echo "status:" . $zip->status . "\n";
$zip->close();
?>

Just experimenting right now...

Link to comment
https://forums.phpfreaks.com/topic/115530-solved-zip-issue/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.