Win XP, WAMP 2.0 Fatal error: Class 'ZipArchive' not found

Topics: Developer Forum, User Forum
Jun 4, 2009 at 4:55 AM

Hi All,

May be there is old thread on this topic but I wan unable to find the same. So posting the question here:

I am using Codeplx PHPExcel class which requires php_zip extension to be enabled. I enabled the extension from PHP Extension menu and service restarted.

Now when I compile a page which requires: ZipArchicve I get following error:

Fatal error: Class 'ZipArchive' not found in D:\Documents and Settings\Administrator\Desktop\PHPExcel-27799\Classes\PHPExcel\Writer\Excel2007.php on line 279

I did restarted the service twice again. I checked the php.ini , the zip extension is enabled there also.

Can any one help me in this regard. What I am doing wrong.

Thanks and best regards,

Developer
Jun 4, 2009 at 5:02 AM

Can you do a quick check:

<?php
error_reporting(E_ALL);
ini_set('display_errors', '1');

$x = new ZipArchive();
var_dump($x);
?>

Basically, you must not get any errors for that test script.

Jun 4, 2009 at 5:10 AM

Thanks Koyama, 

Thanks for the prompt response, now a days It is very rare to find a response from forums.

I tested the same error and got the same error. I think there is somethig wrong with my WAMP PHP settings. 

Can you propose any solution.

 

thanks and best regards,

Jun 4, 2009 at 5:15 AM
This is my php.ini  if can help some how. I checked both:

extension=php_zip.dll
extension=php_zlib_filter.dll

are enabled.


Thanks and Best Regards,


--
Rehan Azher


On Thu, Jun 4, 2009 at 1:10 PM, rehanazher <notifications@codeplex.com> wrote:

From: rehanazher

Thanks Koyama, 

Thanks for the prompt response, now a days It is very rare to find a response from forums.

I tested the same error and got the same error. I think there is somethig wrong with my WAMP PHP settings. 

Can you propose any solution.

 

thanks and best regards,

Read the full discussion online.

To add a post to this discussion, reply to this email (PHPExcel@discussions.codeplex.com)

To start a new discussion for this project, email PHPExcel@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com


Developer
Jun 4, 2009 at 5:29 AM

So you don't have an entry for "zip" when you use phpinfo() ?

It should look something like this:
http://img514.imageshack.us/img514/570/phpinfomozillafirefox20.png

On Windows XP I have only tried XAMPP, and zip was enabled out of the box without any extra configuration. (Only problems I had was some Skype port number conflict at first.)

Maybe you edited the wrong php.ini? Apart from that, I have no ideas.

 

Jun 4, 2009 at 5:36 AM
Thanks Komaya,  I got it, dumb me.  


I am using Nusphere PhpEd and it has its own php.ini installed. I just enabled the extestion on that one and now its working. 


Best Regards,


--
Rehan Azher

On Thu, Jun 4, 2009 at 1:29 PM, koyama <notifications@codeplex.com> wrote:

From: koyama

So you don't have an entry for "zip" when you use phpinfo() ?

It should look something like this:
http://img514.imageshack.us/img514/570/phpinfomozillafirefox20.png

On Windows XP I have only tried XAMPP, and zip was enabled out of the box without any extra configuration. (Only problems I had was some Skype port number conflict at first.)

Maybe you edited the wrong php.ini? Apart from that, I have no ideas.

 

Read the full discussion online.

To add a post to this discussion, reply to this email (PHPExcel@discussions.codeplex.com)

To start a new discussion for this project, email PHPExcel@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com


Aug 8, 2009 at 7:37 PM

Hi, I have got the same problem (Fatal error: Class 'ZipArchive' not found).

I have tried to enable the php_zip.dll but it looks like the php_zip is still not enabled on my computer.

I have already uncommented the following line in php.ini (I search through all my computer and I have only one php.ini file in c:\windows\):

extension=php_zip.dll

I'm not sure if it's the correct way to enable php_zip or not but it doesn't work. I still get the ZipArchive not found error.

Could you please suggest me what else do I have to do to enable the php_zip.dll?

PS: I use php 2.5.6 on Windows Vista.   xml and gd2 enabled already.

Thank you so much

Developer
Aug 8, 2009 at 7:42 PM
Edited Aug 8, 2009 at 7:43 PM

@mattkung: Maybe a stupid question, but did you restart the server after uncommenting that line?

Aug 8, 2009 at 8:05 PM
koyama wrote:

@mattkung: Maybe a stupid question, but did you restart the server after uncommenting that line?

 Oh, so shameful! I got it now.

I have restarted the Apache service several times and it doesn't work, so I spent several hours searching through the discussion board here and also other php discussion board.

And finally I got my problem solved because I got your message and restarted my computer.

I'm really sorry to bother you with such a stupid thing and thank you so much for your very prompt response.