Fatal error: Class 'ZipArchive' not found... WAMP 2.0 PHP 5.2.9-1

Mar 2, 2010 at 4:17 PM
Edited Mar 2, 2010 at 4:18 PM

Hello - just downloaded the latest version (1.7.2) from
http://phpexcel.codeplex.com/releases/view/10719.

Running on a Windows 7 Professional running WAMP V2.0 with PHP 5.2.9-1.

Upon running the "test" "runall.php" contained in the "Tests" folder, I see all of the tests run, however they all appear to generate the same error:
Fatal error: Class 'ZipArchive' not found in C:\wamp\www\Classes\PHPExcel\Writer\Excel2007.php on line 287

Here's sample output from the first two tests...

============== TEST ==============
Test name: 01simple.php

12:04:02 Create new PHPExcel object
12:04:02 Set properties
12:04:02 Add some data
12:04:02 Rename sheet
12:04:02 Write to Excel2007 format

Fatal error: Class 'ZipArchive' not found in C:\wamp\www\Classes\PHPExcel\Writer\Excel2007.php on line 287


============== TEST ==============
Test name: 02types.php

12:04:02 Create new PHPExcel object
12:04:02 Set properties
12:04:02 Set default font
12:04:02 Add some data
12:04:02 Rename sheet
12:04:02 Write to Excel2007 format

Fatal error: Class 'ZipArchive' not found in C:\wamp\www\Classes\PHPExcel\Writer\Excel2007.php on line 287

Now, after searching these forums I have found the following test script:
<?php
error_reporting(E_ALL);
ini_set('display_errors', '1');

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

When I run this script, I get no errors and see the following output:
object(ZipArchive)#1 (5) {
  ["status"]=>
  int(0)
  ["statusSys"]=>
  int(0)
  ["numFiles"]=>
  int(0)
  ["filename"]=>
  string(0) ""
  ["comment"]=>
  string(0) ""
}

Obviously, my "php_zip.dll" extension is uncommented in the php.ini.
This is what my "zip" entry looks like from a phpinfo() call:
http://prntscr.com/4q44

If you can provide me with any hints as to why I am getting this error, I would be very thankful.

Let me know if there is any additional information missing.

Coordinator
Mar 5, 2010 at 9:12 PM
Edited Mar 5, 2010 at 9:21 PM

We did have problems last Summer with a corrupted php_zip.dll for Windows. I can't recall exactly which versions caused the problem, but your Feb 2009 build may be at issue. The solution was to update purely that dll to the most recent version. I'm not sure where you'd find that as http://pecl4win.php.net/ is still unavailable (how many months has it been now?) but I'm sure there must be other sites that maintain more recent windows builds from PECL. http://snaps.php.net/win32/php5.2-win32-latest.zip is probably a last resort because it's a very large download for just one file.

The other possibility that crosses my mind is if you're running Windows 7 64-bit... I've had some problems with 32-bit PHP/Apache myself on Windows 7 64-bit, although in my case Apache crashes whenever a script times out.

 

Mar 29, 2010 at 5:35 PM

Hello,

I am having the exact same issue as cpIMac88 above.  I am also running Windows 7 with a WAMP 2.0 server and php 5.2.11.

I get the exact same error message when trying to run the a few of the sample tests.  I checked php.ini to ensure the extension php_zip is enabled.

However, when I run the test sceipt as mention above:

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

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

I get the following error: Fatal error: Class 'ZipArchive' not found in C:\Users\ADMIN\Desktop\PHP-1.php on line 5.

I am sure this may be an issue with my WAMP stack as opposed to your software, but can you provide any guidance or a known workaround?  Thank you.

Coordinator
Mar 29, 2010 at 10:45 PM

pkenny1999

What does phpinfo() tell you about the zip extension? It should look something like:

zip

Zip enabled
Extension Version $Id: php_zip.c 276389 2009-02-24 23:55:14Z iliaa $
Zip version 1.9.1
Libzip version 0.9.0
Mar 30, 2010 at 2:41 AM

Here is what phpinfo() gave me:

Zip

 

enabled

Extension Version $Id: php_zip.c 287723 2009-08-26 02:16:41Z guenter $
Zip version 1.8.11
Libzip version 0.9.0