mickyginger — 2011-04-23T10:04:56-04:00 — #1
I'm running php 5.2.15 on an apache server, and I want to be able to open and read zip archives with php.
Phpinfo is telling me that zlib is enabled:
'--with-zlib=/usr' '--with-zlib-dir=/usr' (Yes, it does appear twice)
but I don't think I installed it, unless it ships with this release of php.
I have tried to use ZipArchive and zip->open commands and I'm not getting any joy. So I guess two questions arise. 1. Is there anyway of finding out for sure if zlib is actually installed, and 2. Could the --with-zlib command actually be pointing to the wrong folder? I guess the directory should be where the library is stored, rather than where my php files are..?
anthonysterling — 2011-04-23T10:10:05-04:00 — #2
This will tell you if it is available.
'Is ZipArchive Available? %s',
class_exists('ZipArchive') ? 'Yes :)' : 'No :('
mickyginger — 2011-04-23T10:54:11-04:00 — #3
Thanks Anthony, a very elegant code snippet.
It appears I do have ZipArchive support! Whoo-hoo! I guess it was because i was running functions directly form the command-line..?
Anyways, thanks for your help. Much appreciated.