Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I've got a CentOS / Red Hat 5.5 box running the current PHP 5.1.6 package. A user is getting the following error:

Fatal error: Class 'ZipArchive' not found in /var/www/html/<filename.php> on line 225

Based on some reading it looks like PHP wants to have had the --enable-zip flag at compile time, however we are running the packaged version for RedHat / Cent. I'm not excited about compiling PHP from source just to enable this option; is there a way to enable the zip functions without resorting to a custom compile?

Other info... in php.ini I have:

zlib.output_compression = On
; zlib.output_handler =

Thanks in advance for any guidance.

share|improve this question
add comment

2 Answers

If you have the zlib-devel package installed when you install the PHP package, it will count as if the enable-zip flag is set.

yum install zlib-devel && yum install php

You might need to uninstall php if the same version in the repos is installed.

share|improve this answer
add comment

ZipArchive class come with PHP 5.2, you have php 5.1.x in your server

solutions:

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.