$ sudo service memcached start
Starting memcached: memcached.
$ php-shell.sh
PHP-Shell - Version 0.3.1, with readline() support
(c) 2006, Jan Kneschke <jan@kneschke.de>
>> use '?' to open the inline help
>> $mc = new Memcached('start')
Memcached::__set_state(array(
))
>> $mc->set('x','y')
false
>> $mc->getResultCode()
20
>> Memcached::RES_NO_SERVERS
20
我已经启动了memcached,所以大概是服务器正在运行,不是吗?我是否需要做任何其他事情才能找到服务器?
答案 0 :(得分:3)
您需要先连接到服务器...
http://www.php.net/manual/en/memcached.addserver.php
Memcached::addServer('localhost', 11211);