Topics: Developer Forum, User Forum
Nov 20, 2011 at 1:00 AM
  • php version 5.2.15
  • Apache/2.2.17 (Unix) mod_ssl/2.2.17 OpenSSL/0.9.7l DAV/2 PHP/5.2.15
  • mac osx 10.5.8
  • phpexcek version @version    1.7.6, 2011-02-27

I know zip etc. need to be compiled. They appear to be when I:

  • php -m
  • php --re zip
  • php -ri zip

but they don't appear in phpinfo and phpexcel doesn't work.

Anyone got any idea how to get this working on a mac?

php.ini has the (it's been compiled and made) and extension_dir = "/usr/lib/php/extensions/no-debug-non-zts-20060613"

I've trawled the web for info on this - seems to be a recurring issue for lots of people but no clear solution to resolve...

Any help appreciated

Nov 20, 2011 at 11:54 AM

perhaps zip is activated in php-cli, but not for the mod\-php running in your web server. Try restarting the web servre, and check if mod_php perhaps has its own php.ini

Nov 21, 2011 at 9:18 PM

Hi Borft, you're right, it's enabled in cli but not mod. Question is how do I enable it for mod - I haven't a clue...I've restarted the webserver. From what I can see there is only the one php.ini and extensions_dir is right. Any help appreciated, Peter

Nov 21, 2011 at 9:42 PM

Don't know what distribution you are running, but in my Debian servers I have separate dirs for cli, cgi and mod_php:



However, on my Mac I cannot find these dirs ;) What version/distro of php are you running? macports? MAMP?

Nov 21, 2011 at 10:06 PM

It's whatever came preloaded on the mac.

Nov 21, 2011 at 10:20 PM
Edited Nov 21, 2011 at 10:22 PM

your mac came preloaded with a php enabled web server? ;) Mine definitely  did not ;) Although it does come with a php cli.  Besides that, I noticed your php version is rather old ;) php5 from osx is 5.3.6 (is Lion though), whilst the one installed through macports is 5.3.8

Nov 21, 2011 at 10:30 PM

well not preloaded - I just had to uncomment a line in httpd.conf  - LoadModule php5_module libexec/apache2/

Nov 22, 2011 at 9:34 PM

Hi borft, I might just try install snow leopard - seems then it is easier to install zip or a newer version of php with zip compiled. Thanks for your help.

Nov 22, 2011 at 9:41 PM

you could also try installing php+ apache through macports. that way you have recent versions of both, without completely reinstalling your mac :)


If your are reinstalling, I would suggest updating to Lion ;)

Nov 22, 2011 at 9:48 PM

from reading around on the web my impression is that macports & leopard don't work so well - but I'll give it a try

Dec 2, 2011 at 8:24 PM

I found this site, replaced the I had compiled with the one from there and it now works (without any php upgrade or macports or anything)...

So for anyone with mac 10.5 and need ziparchive- I recommend trying this.