|
Posted by Laphan on 12/02/06 21:39
Hi All
Please, please help.
I'm not completely thick, but php terminology for getting and installing
extensions is soooo confusing to me.
All I want to do is use the following code:
<?php
$zip = new ZipArchive;
if ($zip->open('test.zip') === TRUE) {
$zip->extractTo('/my/destination/dir/');
$zip->close();
echo 'ok';
} else {
echo 'failed';
}
?>
But when I run it I keep getting:
Fatal error: Cannot instantiate non-existent class: ziparchive in C...
If I take out the '$zip = new ZipArchive;' line I get:
Fatal error: Call to a member function on a non-object in C...
Standard php code works fine in my IIS server, but this just won't have it.
I downloaded the correct (I think) php_zip.dll for my php 4.4.2.2
installation (I need to keep to v4), put it in the extensions folder (which
works cos I have mysql extens working from here), permissions are right and
I've been in the php.ini to uncomment the extension=php_zip.dll line, but I
still get these bloody errors!
I've done the php info page and I get:
zip
Zip support enabled
zlib
ZLib Support enabled
Compiled Version 1.2.3
Linked Version 1.2.3
DirectiveLocal ValueMaster Value
zlib.output_compression Off Off
zlib.output_compression_level -1 -1
zlib.output_handler no value no value
Is this extract feature only available to php 5 users?
How do I get the equivalent in php 4? All I want to do is extract the whole
contents of 1 zip file and put the extracted contents, should be a folder
containing various files, into another folder.
Aaaarrrggghhh!!
Please help.
Thanks
[Back to original message]
|