Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I've been asked to launch a site that someone else built. It is a Wordpress shop site that needs Memcached to run, and I've been having troubles getting Memcached and the memcache php plugin working on my local server. Before installing memcached and the memcache PHP plugin, I would get this error:

Fatal error: Class 'Memcache' not found in [Path]wp-content/object-cache.php on line 350

Now that I have memcached and the memcache PHP plugin installed (via Homebrew), I get a "No data received" page, and get this error in my Apache error log:

dyld: lazy symbol binding failed: Symbol not found: _mmc_queue_pop
  Referenced from: /usr/lib/php/extensions/no-debug-non-zts-20090626/memcache.so
  Expected in: flat namespace

dyld: Symbol not found: _mmc_queue_pop
  Referenced from: /usr/lib/php/extensions/no-debug-non-zts-20090626/memcache.so
  Expected in: flat namespace

[Sat May 05 16:38:27 2012] [notice] child pid 26491 exit signal Trace/BPT trap (5)

I've tried looking for that pid in Activity Monitor to no avail, and it changes every time I try to load the page. Also, I can't find anything about _mmc_queue_pop anywhere.

I'm running Mac OSX Lion, PHP ver 5.3.8, Memcached ver 1.4.13, and Memcache PHP plugin ver 3.0.6.

Does anyone know how I can fix this?

Thanks!

share|improve this question
1  
Rebuild memcached with -fgnu89-inline in CFLAGS/CXXFLAGS. What happens is the inline keyword under new rules causes _mmc_queue_pop to inline in all instances, leaving nothing for memcache.so to dynamically link to. –  David Schwartz May 6 '12 at 0:06
    
How might I edit the CFLAGS/CXXFLAGS for Homebrew? Would I need to modify somthing in the Ruby Forumla file? –  CourtDemone May 8 '12 at 1:24

2 Answers 2

up vote 4 down vote accepted

As David mentioned in the comments, when building the memcache plugin, NOT memcached itself, you have to add run configure like this:

MACOSX_DEPLOYMENT_TARGET=10.7 CFLAGS='-fgnu89-inline' LDFLAGS='-fgnu89-inline' CXXFLAGS='-fgnu89-inline' ./configure

That worked perfectly for me.

share|improve this answer

I would suggest as a first step to make sure what memcache.so is really linked against. On linux you would use ldd, on OSX it should be otool -L IIRC. This looks like the plugin gets hold of either the wrong one of multiple memcache libraries on the system, or of a version that is incompatible.

share|improve this answer
    
Thanks for otool -L. –  wfaulk May 6 '12 at 2:43
    
I'm not the strongest at this sort of stuff. What exactly would I have to do in the Terminal to do this? –  CourtDemone May 6 '12 at 18:57
1  
I just see that for otool to be available you might need Xcode tools installed. In which case, a manpage should be available. In any way, David probably already has the problem nailed down. –  rackandboneman May 6 '12 at 19:08
    
I've got the newest version of Xcode installed, along with command line tools. As I said in comment to David's post, I don't know how I'm supposed to implement that. Can anyone help me out with that? –  CourtDemone May 6 '12 at 21:19
1  
Check with Homebrew's documentation (if that is where your memcache is also from) on how to set "configure options" and CFLAGS. I suggest you only mess with CFLAGS if there is no "configure option" actually available. I am too unfamiliar with homebrew to give cookbook advice, and generic advice assuming a "./configure --options && make && make install" install cycle might be misleading. Still, familiarity with same cycle is EXTREMELY helpful wenn messing with ANY source build system. –  rackandboneman May 6 '12 at 22:32

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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