Is there any way to enable the class? Or is there a reason why it's disabled? Because I'd really need it. Creating daily backups of my databases and without zipping it it takes a LOT of space.
Thanks in advance,
jkotni6
Is there any way to enable the class? Or is there a reason why it's disabled? Because I'd really need it. Creating daily backups of my databases and without zipping it it takes a LOT of space.
Thanks in advance,
jkotni6
What language are you using? PHP? The zip PHP extension is installed. What's a minimal test case that gives you the error? Is there any more to the error message? Creating a ZipArchive works fine for me.
You can also use the zlib extension to compress data.Code:$z = new ZipArchive();
Last edited by misson; 10-02-2009 at 08:10 AM.
Be sure to read all pages linked in this post; they have further information that should prove useful. When asking for help, make sure you follow Eric Raymond's and Jon Skeet's guidelines for prompt, accurate responses. Please answer any questions I ask; they're not rhetorical (probably). Any posted code is intended as illustrative example, rather than a solution to your problem to be copied without alteration. Study it to learn how to write your own solution.Misson, not Mission.
Fatal error: Class 'ZipArchive' not found in /home/jkotni6/public_html/info.php on line 3No clue why it doesn't work for me. :|Code:<?php $filename = 'info.php'; $zip = new ZipArchive(); // << LINE 3 $filenameZip = $filename . '.zip'; $this_php_version = substr(phpversion(),0,((strpos(phpversion(), '-')===FALSE)?strlen(phpversion()):strpos(phpversion(), '-'))); if ($this_php_version < '5.0.0') { // PHP release equals 4.4.9 or older version if ($zip->open($filenameZip, ZIPARCHIVE::CREATE())!==TRUE) { } else { $zip->addFile($filename); $zip->close(); } } else { // PHP release equals 5 or newer version if ($zip->open($filenameZip, ZIPARCHIVE::CREATE)!==TRUE) { } else { $zip->addFile($filename); $zip->close(); } } ?>
Edit: running your sample gives me the same error as well.
Fatal error: Class 'ZipArchive' not found in /home/jkotni6/public_html/info.php on line 2
Last edited by jkotni6; 10-02-2009 at 08:35 AM.
What host are you on? The samples work on Lotus. Sometimes some extensions accidentally get left out when PHP is built. The best course is to open a support ticket.
Be sure to read all pages linked in this post; they have further information that should prove useful. When asking for help, make sure you follow Eric Raymond's and Jon Skeet's guidelines for prompt, accurate responses. Please answer any questions I ask; they're not rhetorical (probably). Any posted code is intended as illustrative example, rather than a solution to your problem to be copied without alteration. Study it to learn how to write your own solution.Misson, not Mission.
I'm on stoli.
Yes. Just submit a support ticket, and someone will get your archiving plugin installed.