Category Archives: archive

Apache cannot create ZIP-Archive with PHP

I am trying to zip several files together using Apache/PHP(Ubuntu) to make downloads easier. Since my first try did not work out very well I decided to break it down to some test-page:

<?php
    $zipname = '/path/to/app/test.zip';

    $zip = new ZipArchive;
    var_dump($zip->open($zipname, ZipArchive::CREATE)); //Returns TRUE
    if ($handle = opendir('/path/to/app/images/')) {
        while (false !== ($entry = readdir($handle)))
            if ($entry != "." && $entry != ".." && strstr($entry,'.png'))
                $zip->addFile($entry);
        closedir($handle);
    }
    var_dump($zip->close());//Returns TRUE

    var_dump(file_exists($zipname));//Returns FALSE
?>

I tried running chown -R www-data:www-data and chmod 0750 -R . on the folder and made sure the zip-extension is activated:

Zip enabled
Extension Version   $Id: 05dd1ecc211075107543b0ef8cee488dd229fccf $
Zip version 1.11.0
Libzip version  0.10.1

But it still won't create the Zip-file at the specified path..

Anyone has an idea why this happens?

Using Apache Solr for Project Archive

In our company there are many projects that are all contain several informations, e.g. source code, project informations, bug reports or emails. The informations are not on a central place so if you want to search for a solved problem in a past project, you have to search for yourself.

The idea is now to build a project archive that you can search through. We want to use Apache Solr to create a Webapp with which you can search for several informations.

Indexing pdf, word or java files is not the problem in this case. The question is, what is the best solution to gather all the files from different systems. The documents are present in systems like MS Sharepoint, Atlassian Confluence, Jira, SVN or Git.

What is the best strategy to export all the informations from the different systems to gather them in a central place, where the indexing can easily be done, maybe automatically.