【发布时间】:2017-04-03 15:11:26
【问题描述】:
我正在使用 MAMP 在 Codeigniter 3.1.2 上测试 memcached。我的 phpinfo 页面上显示了 memcached(版本:2.2.0)
下面是我的代码。
//In the /Application/config/memcached.php file
$config = array(
'default' => array(
'hostname' => 'new-app.dev',
'port' => '11211',
'weight' => '1',
),
);
.
public function test_caching() {
$this->load->driver('cache');
var_dump($this->cache->memcached->save('foo', 'bar', 600)); // Returns false
}
下面的代码返回:
echo '<pre>';
print_r($this->cache->memcached->cache_info());
Array
(
[new-app.dev:11211] => Array
(
[pid] => -1
[uptime] => 0
[threads] => 0
[time] => 0
[pointer_size] => 0
[rusage_user_seconds] => 0
[rusage_user_microseconds] => 0
[rusage_system_seconds] => 0
[rusage_system_microseconds] => 0
[curr_items] => 0
[total_items] => 0
[limit_maxbytes] => 0
[curr_connections] => 0
[total_connections] => 0
[connection_structures] => 0
[bytes] => 0
[cmd_get] => 0
[cmd_set] => 0
[get_hits] => 0
[get_misses] => 0
[evictions] => 0
[bytes_read] => 0
[bytes_written] => 0
[version] =>
)
)
SSL 安装在 new-app.dev 上。有人可以告诉我我缺少什么吗?
【问题讨论】:
标签: php codeigniter caching memcached