davidz Posted February 28, 2007 Share Posted February 28, 2007 I get this error when I try to create a new zip file: PHP Fatal error: Class 'ZipArchive' not found Here is my code: <?php $zip = new ZipArchive(); $filename = "doc.zip"; $zip->open($filename, ZIPARCHIVE::CREATE); $zip->addFile("test.frm","test.frm"); $zip->addFile("test.dat","test.dat"); $zip->close(); ?> I'm running apache version 2.0.54 on Fedora Core 4 with php version 5.2.1 I'm pretty sure I have zip enabled because php -m shows zip as a module: [root@athena etc]# php -m [php Modules] cgi ctype date dom filter ftp hash iconv json libxml mysql pcre PDO pdo_sqlite posix Reflection session SimpleXML SPL SQLite standard tokenizer xml xmlreader xmlwriter zip zlib [Zend Modules] Any help would be greatly appreciated. Thanks!! Link to comment https://forums.phpfreaks.com/topic/40533-problem-with-ziparchive/ Share on other sites More sharing options...
mrheff Posted February 28, 2007 Share Posted February 28, 2007 hi dood, I am currently using this <a href=http://www.phpconcept.net/pclzip/man/en/index.php?methods-create>pclzip.lib + how to use me!</a> heres the <a href=http://www.phpconcept.net/pclzip/index.en.php#download> dl page </a> I was stuck on zips for ages till i found it the examples are really good use that first link to find out how to use this .lib I hope that helps. WORD p.s. it looks like you dont actually have the class you are calling on the system your calling it from, Read the documentation on the pclzip site it explains it really well, also this axplains classes nicely <a href=http://www.phpfreaks.com/tutorials/85/0.php>wrinting A CLASS</a> Link to comment https://forums.phpfreaks.com/topic/40533-problem-with-ziparchive/#findComment-196153 Share on other sites More sharing options...
davidz Posted February 28, 2007 Author Share Posted February 28, 2007 I've looked at that before. I would prefer to use the built in functions, but I will investigate pclzip. Thanks for the link! Link to comment https://forums.phpfreaks.com/topic/40533-problem-with-ziparchive/#findComment-196155 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.