I have been told by my web host that, despite having php 5.2.9-1 compiled to work with zlib, zip will not be enabled. I am taking this one up the food chain with the web host, but in the meantime, I have to try and get on with it.

Can anyone advise me a reasonable alteranative to

$zip = new ZipArchive();
		if($zip->open($destination,$overwrite ? ZIPARCHIVE::OVERWRITE : ZIPARCHIVE::CREATE) !== true)

as part of a function zipping, on the fly, all files in a directory?

    if the server has the zip functions you can use exec() to call them.

      Looks like not - had ago with a simple script using zip_entry_compressedsize(). Got the error message: Fatal error: Call to undefined function zip_entry_compressedsize(). hey ho. Looks like this is not sensibly do-able in php - but thanks for the suggestion.

      For reasons which would need a minor essay, this site is on a Windows server, and also has asp.net, so I'll have a go at cracking the problem with that. And put pressure on the web host to sort out php.

        Well, if you go to php.net, search for zip_entry_compressedsize you will see documentation for the entire extension. IF you click above the functions, where it says "zip", and then "installation", you'd see

        php.net wrote:

        PHP 5.2.0 and later
        Linux systems

        In order to use these functions you must compile PHP with zip support by using the --enable-zip configure option.
        Windows

        Windows users need to enable php_zip.dll inside of php.ini in order to use these functions.

        The installation intructions for zlib on the other hand says

        php.net wrote:

        Zlib support in PHP is not enabled by default. You will need to configure PHP --with-zlib[=DIR]

        The Windows version of PHP has built-in support for this extension. You do not need to load any additional extensions in order to use these functions.

        So if you have zlib enabled, use the zlib functions.

          I confess I am unsure about how to achieve a zip folder for a series of pdfs (containing text and images) doing that.

            The web host has now enabled the zip class - so I am going to mark this thread resolved. My thanks to those who offered help.

              Write a Reply...