I installed MAMP PRO on my Macbook Pro (10.6) some time ago. Now I would like to use zip functions in php. I found that I must add zip.so to my extension folder and edited php.ini.

On my computer I have two different versions of PHP one in MAMP folder and other in user/lib which was pre-installed on my system. Now I wish to compile my zip library for MAMP version.

I got zip sources for my version of PHP then in terminal called function /Applications/MAMP/bin/php5/bin/phpize so it uses mamp php version

./configure
make

then I moved compile zip.so to extensions/no-debug-non-zts-20060613.

When MAMP is launched it returns this error

[11-Apr-2010 16:33:27] PHP Warning: PHP Startup: zip: Unable to initialize module Module compiled with module API=20090626, debug=0, thread-safety=0 PHP compiled with module API=20060613, debug=0, thread-safety=0 These options need to match in Unknown on line 0

Can somebody explain to me how to do this the right way.

link|improve this question
feedback

1 Answer

I have not run into this exact error but what is telling you is that the Zend API versions are different. 20090626 is from PHP 5.3 so the ./configure command is obviously still finding your system's PHP instead of MAMP's.

Try putting /Applications/MAMP/bin/php5/bin before /usr/bin in your PATH, open up a new Terminal window, and try typing which phpize. If it says /Applications/MAMP/bin/php5/bin/phpize then you've done it.

Make sure you download 5.2.11 from http://www.php.net and extract all source files. I believe the zip extension files are in php-5.2.11/ext/zip -- if so then type this:

cd php-5.2.11/ext/zip
phpize
./configure --enable-zip
make

I believe --enable-zip is the right option. Type ./configure --help to find out the exact syntax.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.