Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

php_zip does not exist in php 5.3.5

Tags:

php

zip

phpexcel

I'm in the process of using PHPExcel. One of the requirements is that I need to enable php_zip.

(...) if you need PHPExcel to handle .xlsx or .ods files you will need the zip extension...

I'm using PHP v5.3.5. and in my php.ini file, I have the following lines:

;extension=php_xmlrpc.dll
;extension=php_xsl.dll
;extension=php_zip.dll

If I remove the ; in the last line, and restart Wampserver, I get the following error message:

PHP Startup: Unable to load dynamic library 'I:/wamp/.../ext/php_zip.dll' - The specified module could not be found.

Reading the web, many says that as of PHP 5.3.0, php_zip is built-in.

If it is built then why is this line still in the configuration?
Do I get the error message because since it's built in, the file has been removed?

PS. Sorry if this is in the wrong forum, but not sure where else to put it.

like image 951
Steven Avatar asked Jul 27 '11 15:07

Steven


3 Answers

In fact, Zip is included by default. It is a bug that the line is still included.

like image 114
marc Avatar answered Nov 17 '22 02:11

marc


marc answer is right. I wanted to add a comment that using

extension_loaded('zip');

returns false as it is no longer an extension, you could use

class_exists('ZipArchive');

to check for it now.

like image 26
Ben Avatar answered Nov 17 '22 02:11

Ben


I've had a similar problem with a different library. WAMP doesn't include many libraries by default for some reason.

What I did was download the full PHP installation as a zip from php.net and the required dll was found in the extensions folder just as it is in WAMP. I just copied it from the zip to the WAMP extension folder and it worked fine.

like image 1
Jason Kaczmarsky Avatar answered Nov 17 '22 03:11

Jason Kaczmarsky