Jump to content

Problem with ZipArchive


davidz

Recommended Posts

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

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>

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.