"-Lost" <spam_ninjaREMOVEME@REMOVEMEcomcast.net> wrote in message
news:oqydnYoF8J1DYezYnZ2dnUVZ_v6dnZ2d@comcast.com. ..
"Laphan" <info@PleaseDontSpam.com> wrote in message
news:12n3slijib4ocba@corp.supernews.com...
> 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
I assume you put the correct PEAR/PECL files in the PEAR directory?
http://us2.php.net/zip
http://pecl.php.net/package/zip
-Lost
Hi Lost
I downloaded v1.8.2, but how do you install and use it?
Are we still talking php v4.x.x or php 5 now? I need to keep to php v4.x
Will this give me the extract faciliity?
Basically I will have a zip file on the server and this zip file consists of
one main folder (the user zips a folder) and inside that you have a min of 3
sub-folders then a number of jpgs, gifs and css files in each of these
sub-folders. All I want to do is extract the zip and get the folder (and
it's sub-folders/files inside it) sat in the same directory as the zip file.
I can then take it from there.
The ExtractTo command seems perfect, but also doesn't appear to work in php
4.
Any ideas?
Thanks