Search code examples
phpmemcachedigbinary

How to enable igbinary with memcached installed first


I have memcached installed with libmemcached. Also I have installed igbinary.

This is my php.ini:

; Directory in which the loadable extensions (modules) reside.
;extension_dir = "./"
extension_dir = "/usr/local/lib/php/extensions/no-debug-non-zts-20060613/"

extension=apc.so
apc.enabled=1
apc.shm_size=128M

extension=memcached.so
session.save_handler=memcached
session.save_path="127.0.0.1:11211"

extension=igbinary.so
session.serialize_handler=igbinary
igbinary.compact_strings=On

.

When I run phpinfo() i see that igbinary is enabled, but not for memcached:

apc
Serialization Support   php, igbinary 

igbinary
igbinary support    enabled
igbinary version    1.1.1
igbinary APC serializer ABI     0

Directive   Local Value Master Value
igbinary.compact_strings    On  On

Phpinfo() about memcached:

memcached
memcached support   enabled
Version     1.0.2
libmemcached version    0.51
Session support     yes
igbinary support    no 

That last line: igbinary support thats the question. Oddly enough, as you can see under the heading apc there is stated: Serialization Support php, igbinary.

So do someone know why I cannot enable igbinary for memcached?

Thanks!


Solution

  • You can check the Memcached::HAVE_IGBINARY constant to see if your memcached extension was compiled using --enable-memcached-igbinary.

    Source: http://php.net/manual/en/memcached.constants.php

    Memcached::OPT_SERIALIZER

    Specifies the serializer to use for serializing non-scalar values. The valid serializers are Memcached::SERIALIZER_PHP or Memcached::SERIALIZER_IGBINARY. The latter is supported only when memcached is configured with --enable-memcached-igbinary option and the igbinary extension is loaded.

    Type: integer, default: Memcached::SERIALIZER_PHP.

    Memcached::HAVE_IGBINARY

    Indicates whether igbinary serializer support is available.

    Type: boolean.