Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

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

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


share|improve this answer

Your Answer


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.