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.


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.


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


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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