This is what helped me with Mac OS X Mountain Lion, XAMPP 1.7.3 (Standard way with "pecl install" doesn't work because it compiles 64 bit extension while XAMPP is build in 32 bit mode)
- I've got memcached server with Xcode
- I downloaded and installed XAMPP Developer Package from http://www.apachefriends.org/en/xampp-macosx.html
(First sign you don't have this installed If you get this kind of warnings
...
grep: /Applications/XAMPP/xamppfiles/include/php/php-5.3.1/php/main/php.h: No such file or directory
grep: /Applications/XAMPP/xamppfiles/include/php/php-5.3.1/php/Zend/zend_modules.h: No such file or directory
...
)
- Instead of manually building memcache extension I've modified PEAR installer by adding line that configures build script with 32 bit architecture flags:
File: /Applications/XAMPP/xamppfiles/lib/php/pear/PEAR/Builder.php
Was:
Line 323: // {{{ start of interactive part
Line 324: $configure_command = "$dir/configure";
Line 325: $configure_options = $pkg->getConfigureOptions();
After modification:
Line 323: // {{{ start of interactive part
Line 324: $configure_command = "$dir/configure";
Line 325: $configure_command .= " CFLAGS='-arch i386' APXSLDFLAGS='-arch i386' ";
Line 326: $configure_options = $pkg->getConfigureOptions();
- Then from terminal I executed this:
cd /Applications/XAMPP/xamppfiles/bin
sudo ./pecl install memcache
- Restarted Apache server
And voila! I have php memcache extension working! Have a nice day! :)
First install Xampp developer tools. Then
sudo /Applications/XAMPP/xamppfiles/bin/pecl install memcache
Also not that apache server restart is needed.
Or you can check this for full guide.http://wiki.cerb5.com/wiki/Setup:Development/XAMPP/Mac_OS_X
转载:http://stackoverflow.com/questions/9744185/how-to-setup-memcache-in-xampp-mac-osx-lion
本文详细介绍了如何在MacOSX Mountain Lion系统中使用XAMPP 1.7.3安装Memcache PHP扩展。由于XAMPP默认为32位模式,而通过pecl install命令安装的Memcache扩展会默认编译为64位,导致无法正常工作。文章提供了修改PEAR安装器的方法来解决这一问题,并给出了具体的步骤。

被折叠的 条评论
为什么被折叠?



