Home > Backend Development > PHP Tutorial > 急!!!Memcache::addserver() 最后一个参数,为什么我不管设置多少,都返回false

急!!!Memcache::addserver() 最后一个参数,为什么我不管设置多少,都返回false

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-06 20:45:04
Original
1014 people have browsed it

<code>$mem = new Memcache;
$mem->addserver('127.0.0.1','11211',true,1,1,1,true,null,10000);
$a = $mem->set('key_arr1',array(1,1,5), 0, 0);
var_dump($a);
$val = $mem->get('key_arr1');
var_dump($val);
</code>
Copy after login
Copy after login

打印出来都是FALSE,但是下面两种连接方式,都是正常的,什么原因,有知道的吗?

<code>$mem->connect('127.0.0.1', 11211);
$mem->addserver('10.10.3.2','11211',true,1,0.2);
</code>
Copy after login
Copy after login

回复内容:

<code>$mem = new Memcache;
$mem->addserver('127.0.0.1','11211',true,1,1,1,true,null,10000);
$a = $mem->set('key_arr1',array(1,1,5), 0, 0);
var_dump($a);
$val = $mem->get('key_arr1');
var_dump($val);
</code>
Copy after login
Copy after login

打印出来都是FALSE,但是下面两种连接方式,都是正常的,什么原因,有知道的吗?

<code>$mem->connect('127.0.0.1', 11211);
$mem->addserver('10.10.3.2','11211',true,1,0.2);
</code>
Copy after login
Copy after login
Related labels:
php
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
php data acquisition?
From 1970-01-01 08:00:00
0
0
0
PHP extension intl
From 1970-01-01 08:00:00
0
0
0
How to learn php well
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template