I tried to run my backup script and got the following error.
I'm guessing the update of php has something to do with this but the newer version shouldn't have broken it.Code:Fatal error: Class 'ZipArchive' not found in /home/......../zip.php on line 21
Posting script in case that helps
I did not make this.Code://how to call zip function include 'zip.php'; zip('/home/pballz/public_html'); //zip.php contents <?php function recurse_zip($src,&$zip,$path_length) { $dir = opendir($src); while(false !== ( $file = readdir($dir)) ) { if (( $file != '.' ) && ( $file != '..' )) { if ( is_dir($src . '/' . $file) ) { recurse_zip($src . '/' . $file,$zip,$path_length); } else { $zip->addFile($src . '/' . $file,substr($src . '/' . $file,$path_length)); } } } closedir($dir); } //Call this function with argument = absolute path of file or directory name. function zip($src) { global $zip_fname; $zip_fname='backup_'.date("Y-m-d_H-i-s").'.zip'; $zip = new ZipArchive; $res = $zip->open($zip_fname, ZipArchive::CREATE); if($res !== TRUE){ echo 'Error: Unable to create zip file'; exit; } if(is_file($src)){$zip->addFile($src,substr($src,$path_length));} else{ if(!is_dir($src)){ $zip->close(); @unlink($zip_fname); echo 'Error: File not found'; exit; } recurse_zip($src,$zip,$path_length); } $zip->close(); } ?>


LinkBack URL
About LinkBacks

