+ Reply to Thread
Results 1 to 7 of 7

Thread: Fatal error: Class 'ZipArchive' not found

  1. #1
    jkotni6's Avatar
    jkotni6 is offline x10Hosting Member jkotni6 is an unknown quantity at this point
    Join Date
    Oct 2005
    Location
    Slovenia
    Posts
    63

    Fatal error: Class 'ZipArchive' not found

    Is there any way to enable the class? Or is there a reason why it's disabled? Because I'd really need it. Creating daily backups of my databases and without zipping it it takes a LOT of space.

    Thanks in advance,
    jkotni6

  2. #2
    misson is offline x10 Spammer misson is a jewel in the rough
    Join Date
    Mar 2008
    Location
    Libertatia
    Posts
    2,506

    Re: Fatal error: Class 'ZipArchive' not found

    What language are you using? PHP? The zip PHP extension is installed. What's a minimal test case that gives you the error? Is there any more to the error message? Creating a ZipArchive works fine for me.
    Code:
    $z = new ZipArchive();
    You can also use the zlib extension to compress data.
    Last edited by misson; 10-02-2009 at 08:10 AM.
    Be sure to read all pages linked in this post; they have further information that should prove useful. When asking for help, make sure you follow Eric Raymond's and Jon Skeet's guidelines for prompt, accurate responses. Please answer any questions I ask; they're not rhetorical (probably). Any posted code is intended as illustrative example, rather than a solution to your problem to be copied without alteration. Study it to learn how to write your own solution.
    Misson, not Mission.

  3. #3
    jkotni6's Avatar
    jkotni6 is offline x10Hosting Member jkotni6 is an unknown quantity at this point
    Join Date
    Oct 2005
    Location
    Slovenia
    Posts
    63

    Re: Fatal error: Class 'ZipArchive' not found

    Fatal error: Class 'ZipArchive' not found in /home/jkotni6/public_html/info.php on line 3
    Code:
    <?php
    $filename = 'info.php';
    $zip = new ZipArchive(); // << LINE 3
    $filenameZip = $filename . '.zip';
    $this_php_version = substr(phpversion(),0,((strpos(phpversion(), '-')===FALSE)?strlen(phpversion()):strpos(phpversion(), '-')));
    if ($this_php_version < '5.0.0') 
    {	// PHP release equals 4.4.9 or older version
    	if ($zip->open($filenameZip, ZIPARCHIVE::CREATE())!==TRUE) 
    	{
    	}
    	else 
    	{
    		$zip->addFile($filename);
    		$zip->close();
    	}
    }
    else 
    {	// PHP release equals 5 or newer version
    	if ($zip->open($filenameZip, ZIPARCHIVE::CREATE)!==TRUE) 
    	{
    	}
    	else 
    	{
    		$zip->addFile($filename);
    		$zip->close();
    	}
    }
    ?>
    No clue why it doesn't work for me. :|

    Edit: running your sample gives me the same error as well.
    Fatal error: Class 'ZipArchive' not found in /home/jkotni6/public_html/info.php on line 2
    Last edited by jkotni6; 10-02-2009 at 08:35 AM.

  4. #4
    misson is offline x10 Spammer misson is a jewel in the rough
    Join Date
    Mar 2008
    Location
    Libertatia
    Posts
    2,506

    Re: Fatal error: Class 'ZipArchive' not found

    What host are you on? The samples work on Lotus. Sometimes some extensions accidentally get left out when PHP is built. The best course is to open a support ticket.
    Be sure to read all pages linked in this post; they have further information that should prove useful. When asking for help, make sure you follow Eric Raymond's and Jon Skeet's guidelines for prompt, accurate responses. Please answer any questions I ask; they're not rhetorical (probably). Any posted code is intended as illustrative example, rather than a solution to your problem to be copied without alteration. Study it to learn how to write your own solution.
    Misson, not Mission.

  5. #5
    jkotni6's Avatar
    jkotni6 is offline x10Hosting Member jkotni6 is an unknown quantity at this point
    Join Date
    Oct 2005
    Location
    Slovenia
    Posts
    63

  6. #6
    descalzo's Avatar
    descalzo is offline Grim Squeaker descalzo has a brilliant futuredescalzo has a brilliant futuredescalzo has a brilliant future
    Join Date
    Jul 2009
    Location
    Ankh-Morpork
    Posts
    7,636

    Re: Fatal error: Class 'ZipArchive' not found

    Quote Originally Posted by misson View Post
    What host are you on?
    Chopin throws the same error.
    Nothing is always absolutely so.

  7. #7
    ichwar's Avatar
    ichwar is offline Community Advocate ichwar is an unknown quantity at this point
    Join Date
    Dec 2008
    Location
    NC, USA
    Posts
    1,454

    Re: Fatal error: Class 'ZipArchive' not found

    Yes. Just submit a support ticket, and someone will get your archiving plugin installed.

+ Reply to Thread

Similar Threads

  1. ?? Fatal error: Class ' _error' not found in
    By izubway in forum Free Hosting
    Replies: 3
    Last Post: 06-01-2009, 01:56 PM
  2. Replies: 3
    Last Post: 08-13-2008, 10:08 AM
  3. Access to 40+ PHP clones and scripts! 500 points
    By paysurf in forum The Marketplace
    Replies: 62
    Last Post: 06-03-2008, 10:57 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers