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?


  • 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

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.


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.

  • 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
  • I need someone who's more familiar with Homebrew. I tried adding CFLAGS lines to memcached's install formula and it didn't install properly. – CourtDemone May 8 '12 at 4:17

Addendum - El Capitan, php56, php56-memcache 3.0.8

After reading David Schwartz and CourtDemone's answers I still didn't get it, until I read this answer on SO about how to edit a homebrew formula.

I added the following to the formula by running brew edit php56-memcache and pasting in the following lines:

   .  20     safe_phpize
   .  21 
   +  22     ENV['MACOSX_DEPLOYMENT_TARGET'] = '10.11'
   +  23     ENV['CFLAGS'] = '-fgnu89-inline'
   +  24     ENV['LDFLAGS'] = '-fgnu89-inline'
   +  25     ENV['CXXFLAGS'] = '-fgnu89-inline'
   +  26 
   .  27     system "./configure", "--prefix=#{prefix}",
   .  28                           phpconfig
   .  29     system "make"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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