LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 04-10-2007, 04:37 PM   #1
vxc69
Member
 
Registered: Jul 2004
Distribution: Ubuntu
Posts: 387

Rep: Reputation: 33
PHP: Cannot instantiate non-existent class: ziparchive


Hello,

I'm writing a script to create a zip archive. I get the error "Cannot instantiate non-existent class: ziparchive in test.php on line 51".

Lines 50, 51 and 52:
Code:
	  
50: fclose($fh);
51: $zip = new ZipArchive;
52: $zipfile = getcwd() . "/" . $User . "-" . $date . "-" . $dirname . ".zip";
PHP was configured with "--with-zip" and it says Zip is enabled under phpinfo()'s Zip section.

What am I missing here?

Any help is appreciated. Thanks.

vxc
 
Old 04-10-2007, 07:06 PM   #2
vxc69
Member
 
Registered: Jul 2004
Distribution: Ubuntu
Posts: 387

Original Poster
Rep: Reputation: 33
Thumbs up

Couldn't figure it out but I found a pear function to get the job done.

If anyone's interested you can find it here.

Another alternative I found was: http://codewalkers.com/seecode/65.html.

Cheers,
vxc

Last edited by vxc69; 04-10-2007 at 07:09 PM.
 
Old 04-10-2007, 10:35 PM   #3
graemef
Senior Member
 
Registered: Nov 2005
Location: Hanoi
Distribution: Fedora 13, Ubuntu 10.04
Posts: 2,379

Rep: Reputation: 148Reputation: 148
Which version of php are you using?
On which OS?
It may not be working because you don't have the ZZIPlib library on your machine?

for later version of PHP you can install it with a package? If you have yum then I think that it is the following that you need
Code:
yum install php-zip
 
Old 04-11-2007, 05:25 AM   #4
vxc69
Member
 
Registered: Jul 2004
Distribution: Ubuntu
Posts: 387

Original Poster
Rep: Reputation: 33
The problem is, I'm running the scripts on a shared server.

The version is PHP 4.3.11 and according to http://au.php.net/zip it looks like you're right.

But my problem was solved using the Pear function I mentioned in my previous post.


Thanks,
vxc
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP: Calling class functions from another class. unreal128 Programming 5 11-24-2006 03:04 AM
Apache? Php? non-existent pages getting served... bulliver Linux - General 2 08-14-2006 07:48 PM
PHP class extends.... with no memory? candela Programming 3 05-03-2006 07:03 AM
PHP: how to use a method from a class in the same class ldp Programming 5 09-17-2004 09:52 AM
Cannot instantiate class from JSP Jose Muņiz Programming 2 07-19-2004 12:52 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 10:45 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration