检查是否安装了memcached?

时间:2014-05-08 14:30:56

标签: php install memcached syntax-error

我使用this指南在Centos 6.5上安装memcached

我先检查了

/etc/init.d/memcached status and 

memcached (pid  14784) is running...

然后重新启动

service httpd restart

但是当我尝试在软件上使用memcached(prosper202)时,我得到了

Fatal error: Call to a member function getCapabilities() on a non-object in /var/zpanel/hostdata/zadmin/public_html/******_com/3rd-parties/wurfl/WURFL/CustomDeviceRepository.php on line 72

我不知道是什么造成的。

这是我的WURFL配置文件

<?php

include($_SERVER['DOCUMENT_ROOT'] . '/202-config.php');

$configuration = array(
    // WURFL File Configuration
    'wurfl' => array(
        'main-file' => 'wurfl.zip',
        'patches' => array("web_browsers_patch.xml"),
    ),
    // Persistence (Long-Term Storage) Configuration
    'persistence' => array(
        'provider' => 'mysql',
        'params' => array('host'=>$dbhost,
                  'port'=>3306,
                  'db'=>$dbname,
                  'user'=>$dbuser,
                  'pass'=>$dbpass),
    ),
    // Cache (Short-Term Storage) Configuration
    'cache' => array(               
        'provider' => 'memcache',
        'params' => 'host='.$mchost.',port=11211,namespace=wurfl',
    ),
);

2 个答案:

答案 0 :(得分:1)

啊哈!您的问题与memcached的安装无关。请注意,memcachememcached是两种不同的缓存机制。

您需要确保您的服务器已安装memcacheapc以便WURFL能够正常缓存。

答案 1 :(得分:0)

键入以下内容以查看 memcached 是否存在: which memcached

检查memcached版本: memcached -h