Results 1 to 4 of 4

Thread: Class zipArchive not found

  1. #1
    Registered Member
    Join Date
    Jan 2004
    Posts
    76

    Default Class zipArchive not found

    We are trying to unzip a file. We are running php 5.2.0 with zip on a WHM 10.8.0 cPanel 10.9.0-R57 CentOS 4.4 i686 - WHM X v3.1.0

    After upgrading to 5.2.0, we
    ./configure --enable-zip
    make
    make install
    no errors, but in the phpinfo it does not show enable zip and when we try to open the zip file we receive the error:
    Class ZipArchive not found

    Any help would be greatly appreciated.

    Thanks for all your help,
    Andy

  2. #2
    Registered Member Rafaelfpviana's Avatar
    Join Date
    Mar 2004
    Location
    Brazil
    Posts
    142

    Default

    hello there,

    this week I had a custumer with the same problem and what I learned was that eventhough PHP.net says that PHP 5.2 comes with the ZIP library as bundle for some reason PHP on Cpanel servers don't get compiled with it.

    This isn't new, the compile Apache has the Zip option but I never saw it working, and I've tested on 10 different servers.

    What I suggest is that you compile de PECL availble here http://pecl.php.net/package/zip

    well, good luck.

  3. #3
    Registered Member Rafaelfpviana's Avatar
    Join Date
    Mar 2004
    Location
    Brazil
    Posts
    142

    Default

    ok, to install the ZIP PECL library do this:

    first create a phpinfo file to get necessary informations, like this:

    PHP Code:
    <?
    phpinfo();
    ?>
    save it as phpinfo.php any where in the server, but remember, you are going to need to see this file on a browser.

    open the browser and open that phpinfo file that you've just created and search for these 2 values:

    Configuration File (php.ini) Path

    and

    extension_dir

    login into your server as root and type this:

    Code:
    cd /usr/src/
    wget http://pecl.php.net/get/zip-1.8.0.tgz
    tar -xzf zip-1.8.0.tgz
    rm -f zip-1.8.0.tgz
    cd ./zip-1.8.0
    phpize
    ./configure
    make
    make install
    when you type make install something like this will be written on the screen:

    Code:
    Installing shared extensions:     /usr/local/lib/php/extensions/no-debug-non-zts-20060613/
    write that down somewhere, copy and paste it on a notepad.

    what you just did was compile the library, now you need to edit php.ini file to turn the extension on:

    Code:
    vi you_php_ini_path_here
    type / to search and search for enable_dl and make sure this is set to on


    type / to search and search for extension_dir and paste the thing I told you to paste on the notepad, so it looks something like this:

    Code:
    extension_dir   = "/usr/local/lib/php/extensions/no-debug-non-zts-20050922/";
    now right bellow that add this

    Code:
    extension=zip.so
    now just restart apache and look at the phpinfo file.

    any questions, just ask
    Last edited by Rafaelfpviana; 11-21-2006 at 06:44 AM.

  4. #4
    Registered User
    Join Date
    Nov 2006
    Posts
    1

    Default

    i did everything that you said, and it seemed to work perfectly. I restarted apache and looked at my phpinfo file. Now how would i install the --enable-zip for php. I can't seem to find the php directory that has the configure command. I've done a find / -name 'configure' and there are a few for other programs, but nothing for php. Yet php is on the server and working, because my phpinfo page works.

    The extension_dir is correct on the phpinfo file too.
    Last edited by domflann; 11-24-2006 at 04:14 PM.

Similar Threads

  1. Enabling ZipArchive
    By billybag in forum New User Questions
    Replies: 3
    Last Post: 06-27-2009, 09:04 PM
  2. Fatal error: Class 'PDO' not found in
    By crazyaboutlinux in forum New User Questions
    Replies: 7
    Last Post: 05-07-2009, 02:24 AM
  3. Fatal error: Class 'Zend_Loader' not found
    By d0840001 in forum Discusión en Español
    Replies: 1
    Last Post: 06-05-2008, 03:07 AM
  4. Fatal error: Class 'Zend_Loader' not found
    By d0840001 in forum cPanel & WHM Discussions
    Replies: 0
    Last Post: 06-01-2008, 11:22 AM
bargain