Link to home
Create AccountLog in
Avatar of worldofwires
worldofwiresFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Trouble with Zip Archives

Hi,

I'm having issues getting the PHP Zip_archive working. It required in the PHPExcel class when creating a xlsx file. I developed the code on XAMPP and it worked fine but the production environment is a much more basic build. I've installed zLib and the php_zip.dll is there and referenced in php.ini. Is there anything else I may need or could it be either of the aforementioned not working correctly (can they be tested easily?).

Fatal error: Class 'ZipArchive' not found in C:\htdocs\inc\classes\PHPExcel\PHPExcel\Writer\Excel2007.php on line 226

Windows Server 2003
Apache 2.2.9
PHP 5.2.6
zlib 1.2.3

Any help is appreciated,

John
Avatar of Sylvain Drapeau
Sylvain Drapeau
Flag of Canada image

Hello !

Have you compiled PHP with zip support by using the "--enable-zip" configure option ?

Syldra
Avatar of worldofwires

ASKER

I compiled it so long ago I can't remember. Although due to the fact I had to add the php_zip.dll manually, I'd assume no. I should mention that I just copied the the zip.dll from the XAMPP build which worked in development.

Thanks,
John
I'm curious about the 'compiled with' question as it is not the first time I've heard the question. I don't recall many options when installing php, is that because I may have used the the installer/msi rather than the command line? Is consider updating php using a new method as my build is getting old...
ASKER CERTIFIED SOLUTION
Avatar of Ray Paseur
Ray Paseur
Flag of United States of America image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Hi Ray,

I've read that page a few times before posting here thinking I was missing something, and I might well be. I installed the zLib after reading it and made sure that the php_zip.dll was in my ext folder (which it is).

This is an excerpt from the php.ini...

[PHP_MYSQL]
extension=php_mysql.dll
[PHP_PDO]
extension=php_pdo.dll
[PHP_PDO_MYSQL]
extension=php_pdo_mysql.dll
[PHP_PDO_PGSQL]
extension=php_pdo_pgsql.dll
[PHP_SOAP]
extension=php_soap.dll
[PHP_SOCKETS]
extension=php_sockets.dll
[PHP_GD2]
extension=php_gd2.dll
[PHP_MBSTRING]
extension=php_mbstring.dll
[PHP_EXIF]
extension=php_exif.dll
[PHP_ZLIB_FILTER]
extension=php_zlib_filter.dll
[PHP_ZIP]
extension=php_zip.dll

I've tried to use the php_info() before to see if it was there but with no luck, I guess that answers my question... So, if it is the php_zip.dll not being recognised, where can I get a new dll? I was looking online for ages without success so ended up just pinching it from my local XAMPP build.

Thanks for you time,

John

Production server software: Apache/2.2.9 (Win32) mod_ssl/2.2.9 OpenSSL/0.9.8h PHP/5.2.6 running on Windows Server 2003.
SOLUTION
Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Ok, thanks Ray.
I have found a dll via google but I have trust issues with sites I don't know. It is from http://www.dlldll.com but is only 40kB compared to the one I lifted from XAMPP which was 73kB. With some trepidation, I've just tried it but the result is the same. Could it be a compatibility issue with zLib or are they not that closely related?

Thanks.
UPDATE:
I got the php_zip.dll for PHP 5.2.6 from the zip file at PHP.net Releases. For those, like me, who need to find the appropriate dll for a certain version, this is a good link.

Unfortunately, it hasn't solved my problem. I've now tried three separate php_zip.dll's and I'm fairly confident one of them would/should have worked. To recap, the dll is being calling from the php.ini but no mention of the zip module/extension is appearing in the php_info. I've got zlib installed and I think that's working but don't know how to test it.

Anyone have any ideas?
SOLVED:
Finally got it working with a php_zip.dll file from a build of PHP 5.2.9. No idea why the other three didn't work.
My post linking to the releases page of the PHP site will enable others suffering similar problems to find components in previous builds. It is how I solved my issue.