SearchSearch   

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

 
   Webmaster Forums (Home) -> PHP RSS
Next:  newbie, how do I put a required field  
Author Message
Laphan

External


Since: Nov 08, 2006
Posts: 10



(Msg. 1) Posted: Sat Dec 02, 2006 9:39 pm
Post subject: php zip code will NOT work on my WinXP Pro IIS installtion!!
Archived from groups: alt>php, others (more info?)

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 top
J.O. Aho

External


Since: May 31, 2006
Posts: 2034



(Msg. 2) Posted: Sat Dec 02, 2006 10:55 pm
Post subject: Re: php zip code will NOT work on my WinXP Pro IIS installtion!!
Archived from groups: per prev. post (more info?)

Laphan wrote:

> 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';
> }
> ?>

> 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
Back to top
Laphan

External


Since: Nov 08, 2006
Posts: 10



(Msg. 3) Posted: Sat Dec 02, 2006 10:55 pm
Post subject: Re: php zip code will NOT work on my WinXP Pro IIS installtion!!
Archived from groups: per prev. post (more info?)

"J.O. Aho" <user.RemoveThis@example.net> wrote in message
news:4teb3aF13q95rU1@mid.individual.net...
Laphan wrote:

> 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';
> }
> ?>

> 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?
Back to top
J.O. Aho

External


Since: May 31, 2006
Posts: 2034



(Msg. 4) Posted: Sat Dec 02, 2006 11:47 pm
Post subject: Re: php zip code will NOT work on my WinXP Pro IIS installtion!!
Archived from groups: per prev. post (more info?)

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
Back to top
Jim Michaels

External


Since: Aug 18, 2007
Posts: 1



(Msg. 5) Posted: Sat Aug 18, 2007 12:53 pm
Post subject: Re: php zip code will NOT work on my WinXP Pro IIS installtion!!
Archived from groups: per prev. post (more info?)

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.
Back to top
Display posts from previous:   
       Webmaster Forums (Home) -> PHP
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum