Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to setup memcache, in XAMPP mac osx lion

How to setup memcache in XAMPP, Mac OSX Lion. It was pretty simple in Leopard(using this link http://m-schmidt.eu/2010/03/30/develop-memcached-web-apps-with-xampp-under-mac-os-x/), but i installed fresh Lion and it seems that memcache is not installing.

I tried this one in https://gist.github.com/1301997 but no result!!

Can anyone suggest what to do.

like image 801
tarique Avatar asked Mar 16 '12 20:03

tarique


2 Answers

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! :)

like image 157
Gramotei Avatar answered Nov 10 '22 18:11

Gramotei


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

like image 43
Xiangyu Avatar answered Nov 10 '22 18:11

Xiangyu