2

I'm using memcached (installed via brew on OS X) on my Drupal site successfully for already few months.

However this error start happening out of blue after very long page load:

( ! ) Warning: Memcached::getMulti(): could not unserialize value, no igbinary support in sites/all/modules/contrib/memcache/dmemcache.inc on line 375

Why this is happening, why do I need igbinary (which I think I have) and how to fix it?


It seems I've already php56-igbinary installed.

$ php -i | grep igbinary
Additional .ini files parsed => /usr/local/etc/php/5.6/conf.d/ext-igbinary.ini,
igbinary
igbinary support => enabled
igbinary version => 1.2.1
igbinary APC serializer ABI => no
igbinary session support => yes
igbinary.compact_strings => On => On
igbinary support => yes
memcached.serializer => igbinary => igbinary
Registered serializer handlers => php_serialize php php_binary wddx igbinary 
kenorb
  • 155,785
  • 88
  • 678
  • 743

1 Answers1

2

Igbinary is a replacement for the standard PHP serializer which normally consuming a lot of time and space storing the data in textual representation. With support for that extension, savings are significant when using memcached or similar memory based storages (e.g. Redis), because all PHP data structures are stored in a compact binary form.

The problem which I dealt it happened, because there were two PHP versions, one used from CLI which had igbinary support (e.g. used by drush) and another one used by Apache/MAMP didn't have igbinary:

$ /Applications/MAMP/bin/php/php5.6.10/bin/php -i | grep igbinary
igbinary support => no

So for some reason some objects were cached using PHP with igbinary, then it failed to be unserialized by PHP without that support.

It seems MAMP doesn't provide igbinary support for their PHP bundle, therefore the solutions include:

  • extension needs to be compiled manually and loaded into MAMP (--enable-memcached-igbinary),
  • disable igbinary in PHP CLI (not recommended), so it won't conflict with Apache,
  • keep restarting memcached, e.g. brew services restart memcached (OS X)
  • use PHP builtin server instead which has support for igbinary, like: php -S localhost:8888
kenorb
  • 155,785
  • 88
  • 678
  • 743