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安装器的方法来解决这一问题,并给出了具体的步骤。

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)

(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

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值