php – 如何使用memcached首先启用igbinary

前端之家收集整理的这篇文章主要介绍了php – 如何使用memcached首先启用igbinary前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我有memcached安装了libmemcached.我也安装了igbinary.

这是我的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

.

当我运行PHPinfo()我看到igbinary被启用,但不是为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

关于memcached的PHPinfo()

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

最后一行:igbinary支持这个问题.奇怪的是,正如你可以看到,在apc的标题下有:序列化支持PHP,igbinary.

那么有人知道为什么我不能为memcached启用igbinary?

谢谢!

您可以检查Memcached :: HAVE_IGBINARY常量,以查看您的memcached扩展名是否使用–enable-memcached-igbinary进行编译.

资料来源: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.

原文链接:https://www.f2er.com/php/130805.html

猜你在找的PHP相关文章