Jan
29
ZendServer Community Edition on Mac OS X: compiling PHP extensions
January 29, 2011 | 4 Comments
This post aims to explain how to compile a PHP extension for ZendServer CE on Mac OS X based on my experience with the memcache extension. As it turns out, the memcache extension included in ZendServer CE 5.0.4 is version 2.2.5 which doesn’t work with the latest version of the memcached server insatlled by macposts as detailed in my earlier post about memcached. I had to build the memcache.so extension version 2.6 using pecl. Here’s how
- go to /usr/local/zend/lib/php_extensions and backup your memcache.so file in memcache.so.bak
- go to /tmp and extract libmemcached which you can download from the libmemcached website
- go to the extracted directory named libmemcached-0.44 and install the library
1 2 3 4 | tar -xvzf libmemcahed-0.44.tar.gz cd libmemcached-0.44 ./configure ; make sudo make install |
- now, still being in /tmp, using pecl and phpize, download and install memcache
1 2 3 4 5 6 7 8 | /usr/local/zend/bin/pecl download memcache tar -xvzf memcache-2.2.6 cd memcache-2.2.6 /usr/local/zend/bin/phpize #configure using the php-config of Zend Server AND forcing the architecture to 32bits as it is what was used to compile the ZendServer ./configure --with-php-config=/usr/local/zend/bin/php-config MACOSX_DEPLOYMENT_TARGET=10.6 CFLAGS="-arch i386 -g -Os -pipe -no-cpp-precomp" CCFLAGS="-arch i386 -g -Os -pipe" CXXFLAGS="-arch i386 -g -Os -pipe" LDFLAGS="-arch i386 -bind_at_load" make sudo make install |
- Enable the extension in your php.ini by uncommenting the line extension=memcache.so
- Restart Apache
1 | /usr/local/zend/bin/apachectl restart |
- Go to a phpinfo page to make sure the extension memcache was installed

This should work for most extensions available in the PECL library.
External Links
- Some notes on Zend Server CE for Mac OS X
- Installing memcached PHP extension on OS X Snow Leopard
- Compiling PHP extensions with Zend Server
Filed under: Computing, Mac OS X, PHP, Système
Tagged with: memcache, memcached, pecl, phpinfo, phpize, Zend Server
Liked this page?
Tweet it
Tweet
Subscribe to the RSS feed or sign up for the newsletter now.
New blog post: ZendServer Community Edition on Mac OS X: compiling PHP extensions: This post aims to explain how… http://bit.ly/gz9V4o
Thanks a lot Samantha!
I just wasted half of my day trying to install that memcache.
You saved me the other half.
Good luck.
[...] so as a 64-bit binary. However, Zend Server community edition is compiled using 32-bit. I found a blog post which explains exactly how to compile the PECL module. The solution worked out perfectly. This [...]
[...] Schindler on “Compiling Gearman (or anything) for Zend Server CE on Snow Leopard”. And here is one more. Perhaps there is something different in the ‘./configure’ commands from [...]