0

我有 PHP:

root@15048:/# php -v

PHP 7.0.3-1~dotdeb+8.1 (cli) ( NTS ) Copyright (c) 1997-2016 The PHP Group Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies with Zend OPcache v7.0.6-dev,版权所有 (c) 1999-2016,由 Zend Technologies 提供

安装了 memcached 库:

在此处输入图像描述

我已经编写了使用 memcached 的类:

public $cache;

public function __construct() {
    $this->cache = new Memcached();
    $this->cache->setOption(Memcached::OPT_LIBKETAMA_COMPATIBLE, true);
    if (!count($this->cache->getServerList())) {
        $this->cache->addServer('127.0.0.1', 11211);
    }
}

public function get( $key ) {
    return $this->cache->get( $key );
}

public function set( $key, $var, $time ) {
    /*if ( $this->cache->set( $key, $var, $time ) )
        return true;*/
    return false;
}

public function flush() {
    if ( $this->cache->flush() )
        return true;
    return false;
}

public function __destruct() {
    $this->cache->quit();
}

但是当我取消注释“设置”函数时,只需取消注释,永远不要调用它,php崩溃......

我试过memcached“添加”功能有同样的问题......

[26-Mar-2016 14:26:42] 警告:[pool www] 孩子 15541 在信号 11 (SIGSEGV) 上退出 26.168556 秒后开始

[26-Mar-2016 14:26:42] 通知:[pool www] 孩子 15566 开始

[26-Mar-2016 14:26:42] 警告:[pool www] 孩子 15542 在信号 11 (SIGSEGV) 上退出 10.321759 秒后从开始

[26-Mar-2016 14:26:42] 通知:[pool www] 孩子 15567 开始

[2016 年 3 月 26 日 14:26:43] 警告:[pool www] 孩子 15567 在信号 11 (SIGSEGV) 上从开始 1.305421 秒后退出

[26-Mar-2016 14:26:43] 通知:[pool www] 孩子 15578 开始

[26-Mar-2016 14:26:44] 警告:[pool www] 子 15540 在信号 11 (SIGSEGV) 上退出 28.413800 秒后从开始

[26-Mar-2016 14:26:44] 通知:[pool www] 孩子 15579 开始

4

0 回答 0