tags:

views:

158

answers:

1

I'm writing software that requires the user to have php 5, but nothing else in the way of extra apache modules, etc.

Is there a vanilla php5 method for unzipping an archive?

I found this:

http://nz2.php.net/manual/en/function.ziparchive-extractto.php

But can everyone using php 5 use this? No extra modules necessary?

+2  A: 

According to the documentation (as Rob pointed out), PHP needs to be compiled with the --enable-zip option for linux or the php_zip.dll needs to be enabled for windows. That said, no extra apache modules are needed. And I would venture to say that almost all PHP installations have this enabled already. To the point where you can almost depend on it being there. That said, the safest possible bet would, of course, be to not assume anything. So at the end of the day, it is a judgement call.

http://nz2.php.net/manual/en/zip.installation.php

Abinadi