PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Saturday, November 12, 2022

[FIXED] How to enable igbinary with memcached installed first

 November 12, 2022     igbinary, memcached, php     No comments   

Issue

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.



Answered By - gimpe
Answer Checked By - Candace Johnson (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

1,214,590

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © 2025 PHPFixing