Enabling php_zip

Nov 9, 2009 at 6:46 PM

Hey everyone,

I tried really hard to find this on the internet before asking but I really couldn't find anything.  How, exactly, do I enable php_zip on a linux server?

Here is the code that I'm receiving:

Fatal error: Class 'ZipArchive' not found in /home/mypaec5/public_html/phpexcel/Classes/PHPExcel/Writer/Excel2007.php on line 287

 

What do I write in the php.ini file?  Where is that file?


Thanks for your help,

Andy


Developer
Nov 10, 2009 at 2:02 AM

Judging from the path in your error message it looks like you are on a shared web host. Try write an email to the support asking if they can enable the zip extension.

I have tried this a couple of times, and usually they have been helpful.

To help them see the problem, create this simple script, and give them a link so can see the error message

 

<?php
$zip = new ZipArchive();
?>

Nov 11, 2009 at 4:20 PM

Hi Koyama,

Thanks for your help and suggestion.  This is what I received from my hosting service (inmotionhosting.com):

 

Hello,
Thank you for contacting us about this. While we are able to assist in the installation of the said modules we do not have specific information about how to make use of the code.  Looking at the php.ini php_zip is properly installed.  Please let us know if you have any other questions and we can try to assist.  Otherwise I would advise looking over the official documentation of the php_zip module.
Best Regards,
Shelby DeNike

 

Hello,

Thank you for contacting us about this. While we are able to assist in the installation of the said modules we do not have specific information about how to make use of the code.  Looking at the php.ini php_zip is properly installed.  Please let us know if you have any other questions and we can try to assist.  Otherwise I would advise looking over the official documentation of the php_zip module.

Best Regards,

Shelby DeNike

 

I should be good to go correct?

 

Thanks,

Andy

 

Developer
Nov 11, 2009 at 9:31 PM

Hmm... I think they are mistaken. What do you get with phpinfo() ?

Create file called info.php:

<?php
phpinfo();
?>

There should be an entry for zip (Note that zlib is something else):



If there is not and entry for zip (and I think there is not), send them a link to your info.php so they can see that the entry is missing.

 

Nov 12, 2009 at 3:46 PM

Hi Koyama,

  The zip module is definitely not listed there.  I showed it to my web hosting provider but they sill insist that the module is installed.  Is there anything else that I can tell them to check or do?

 

Thanks!

Andy

Developer
Nov 12, 2009 at 11:12 PM

I'm surprised that they have not at this point found the problem or helped with the solution. Until that zip extension starts showing up on the phpinfo() page there is no chance that your scripts will work.

I suggest you ask them what it takes to get the zip entry to show on the phpinfo() page. Ask them whether it requires action from their side or your side.