views:

58

answers:

1

Every time I try to use the add() function for memcached, I get the following error:

A PHP Error was encountered

Severity: Warning

Message: MemcachePool::add(): The lowest two bytes of the flags array is reserved for pecl/memcache internal use

Filename: libraries/memcached_library.php

Line Number: 92

What could be wrong? I'm using this library for codeigniter: http://github.com/trs21219/memcached-library

+1  A: 

Are you on 64 bits? It looks like it's a recently found bug with pecl/memcache: http://pecl.php.net/bugs/bug.php?id=18567

It seems like it has to do with the compression flag. It can't be a boolean anymore, it needs to be an integer according to this source code

/**
 * The compressed argument on Memcache::add, Memcache::set and Memcache::replace takes
 * an integer not a boolean. Since pecl/memcache 3.0.3 booleans now leads to warnings like
 * The lowest two bytes of the flags array is reserved for pecl/memcache internal use
 */
Fanis
Perfect. Thanks. I changed compression from TRUE to 0 and everything works fine now.
Matthew