S
S
seredaes2017-03-23 21:27:19
PHP
seredaes, 2017-03-23 21:27:19

How to fix memcache?

$memcache = new memcache;
$memcache->connect('127.0.0.1','11211');
$memcache->set('www',12,0,500);
echo $memcache->get('www');
Here is the code that works great.
If I use this code:
$memcache->set('www',12,500);
// only 3 parameters
then error
Warning: MemcachePool::set(): The lowest two bytes of the flags array is reserved for pecl/memcache internal use in...
restarted Apache and now error
Warning: MemcachePool::set(): The lowest two bytes of the flags array is reserved for pecl/memcache internal use
How can I fix this? Can you start the server with some parameter?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
mishania666, 2017-03-23
@mishania666

according to the manual ( php.net/manual/ru/memcache.set.php ) the third parameter should be a flag, apparently 500 is an invalid value for the flag ;-)

S
seredaes, 2017-03-24
@seredaes

In general, the situation is this. Under Windows, there is only memcache, although the file is called memcached. And there you need to pass 4 parameters, and under unix * similar axes are memcached and only 3 parameters can be passed there. Here is such a situation.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question