1

Can't find anything on this one. I have a zip file on my server that doesn't openly support the zip_*() functions. DreamHost's support staff has said that I can modify the php.ini file to allow these… but I was wondering if there's just a ini_set() I can use to turn the zip decompression functions on.

Thanks a million! -Joel

Joel Hackney
  • 147
  • 1
  • 5
  • 13

1 Answers1

4

zip's done via a module. It couldn't be a simple ini_set() to turn it on. If it's not installed in PHP by default, you'd need to use dl() to load the module at runtime. I can't see a shared hoster enabling this, as it'd allow anyone to load malicious libraries into the webserver process at will.

I think dreamhost might have been thinking of transparent gzip compression of PHP's output instead, which can be controlled via ini_set().

Marc B
  • 356,200
  • 43
  • 426
  • 500
  • Marc, thank you so much for the insight. I've got a Virtual Private Server, so they're a little more lenient than a shared server. So I'd like to try and add the module at runtime then first - would you know where i can get that module? what it's called? :-/ I really do appreciate your help man. – Joel Hackney Jul 19 '11 at 20:47
  • If it's your server, try looking in the php extensions directory (the location should be in the php.ini and/or phpinfo() output. Most likely it's something like 'zip.so' or (zip.dll if you're on Windows), but that's just a guess. – Marc B Jul 19 '11 at 20:53
  • system('unzip -o ' . $file); worked like a BOSS! don't understand how though, but I'm not going to complain... – Joel Hackney Jul 19 '11 at 21:09
  • That's just invoking an external zip program. If it works, great, but be careful to clean up as you'll be leaving the unzipped files lying around. – Marc B Jul 19 '11 at 21:12