检查是否安装了memcached


Check if memcached is installed?

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

我先检查

/etc/init.d/memcached status and 
memcached (pid  14784) is running...

然后重新启动

service httpd restart

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

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',
    ),
);

啊哈!您的问题不在于您安装的memcached。请记住,memcachememcached是两种不同的缓存机制。

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

输入以下命令查看memcached是否存在:which memcached

查看memcached版本:memcached -h