php zip code will NOT work on my WinXP Pro IIS installtion!!

php zip code will NOT work on my WinXP Pro IIS installtion!!

am 02.12.2006 22:39:58 von Laphan

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:

$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

Re: php zip code will NOT work on my WinXP Pro IIS installtion!!

am 02.12.2006 22:55:54 von Shion

Laphan wrote:

> All I want to do is use the following code:
>
> > $zip = new ZipArchive;
> if ($zip->open('test.zip') === TRUE) {
> $zip->extractTo('/my/destination/dir/');
> $zip->close();
> echo 'ok';
> } else {
> echo 'failed';
> }
> ?>

> If I take out the '$zip = new ZipArchive;' line I get:
> Fatal error: Call to a member function on a non-object in C...

This tells you that you are trying to use an object without created it.


> But when I run it I keep getting:
> Fatal error: Cannot instantiate non-existent class: ziparchive in C...

This tells you that you are trying to create an object to which you don't have
the class description for, you must include that file including the ZipArchive
class. If you don't have that file, then you can't use the code you want.


//Aho

Re: php zip code will NOT work on my WinXP Pro IIS installtion!!

am 02.12.2006 23:23:33 von Laphan

"J.O. Aho" wrote in message
news:4teb3aF13q95rU1@mid.individual.net...
Laphan wrote:

> All I want to do is use the following code:
>
> > $zip = new ZipArchive;
> if ($zip->open('test.zip') === TRUE) {
> $zip->extractTo('/my/destination/dir/');
> $zip->close();
> echo 'ok';
> } else {
> echo 'failed';
> }
> ?>

> If I take out the '$zip = new ZipArchive;' line I get:
> Fatal error: Call to a member function on a non-object in C...

This tells you that you are trying to use an object without created it.


> But when I run it I keep getting:
> Fatal error: Cannot instantiate non-existent class: ziparchive in C...

This tells you that you are trying to create an object to which you don't
have
the class description for, you must include that file including the
ZipArchive
class. If you don't have that file, then you can't use the code you want.


//Aho


Hi

Many thanks for the reply.

So what do I do?

I thought this was a standard command set in php? Is it not available in
php 4?

Re: php zip code will NOT work on my WinXP Pro IIS installtion!!

am 02.12.2006 23:47:56 von Shion

Laphan wrote:

> So what do I do?

you have to include the include statement in top of your script

include '/path/to/the/file/with/the/class/ZipArchive.php';


> I thought this was a standard command set in php? Is it not available in
> php 4?

The ZipArchive class isn't part of any version of PHP, it's a class that
someone has made that you can add to your own code with help of the include
functions.


//Aho

Re: php zip code will NOT work on my WinXP Pro IIS installtion!!

am 18.08.2007 21:53:05 von Jim Michaels

J.O. Aho wrote:
> Laphan wrote:
>
>> So what do I do?

from the manual,
Requirements
PHP 4
The bundled PHP 4 version requires » ZZIPlib, by Guido Draheim, version
0.10.6 or later

PHP 5.2.0 or later
This extension uses the functions of » zlib by Jean-loup Gailly and Mark
Adler.


--

------------------------------------
Jim Michaels
for email, edit the address

RAM Disk is *not* an installation method.