SnowLeopard, PHP5 ZipArchive Support

First of all I would like PHP5 ZIP Support under MacOS X Snow Leopard. So there is an easy PECL Extension that could be installed with, but it wouldn't work:

$ pecl install zip
[...]
php_pcre.h:29:18: error: pcre.h: No such file or directory
php_zip.c:602: error: 'pcre' undeclared (first use in this function)
[...]

Now i started to compile PHP myself, ... waitingwaitingerrorkilling myselfwaiting ... Okey it takes to long time. Currently i've found an really easy way to fix this problem.

First: Install MacPorts, it requires XCode. Second: Compile PCRE with MacPorts

port install pcre

Third: Install the PECL ZIP extension via this special command :P

$ CPPFLAGS="-I/opt/local/include" pecl install zip

Fifth: Add the extension to the php.ini file /etc/php.ini

extension=zip.so

Restart your apache and thats it ;)

Posted

February 08, 2010, 2:27 pm

Tags

, , , , , , ,

More

Permalink

Comments

Send your comment by mail.