PHP 致命错误:在 中找不到类“Memcached”

2022-08-30 21:19:12

php -v :

PHP 5.5.10-1+deb.sury.org~precise+1 (cli) (built: Mar 27 2014 16:18:01) 
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies
    with XCache v3.1.0, Copyright (c) 2005-2013, by mOo
    with Zend OPcache v7.0.3, Copyright (c) 1999-2014, by Zend Technologies
    with XCache Optimizer v3.1.0, Copyright (c) 2005-2013, by mOo
    with XCache Cacher v3.1.0, Copyright (c) 2005-2013, by mOo
    with XCache Coverager v3.1.0, Copyright (c) 2005-2013, by mOo

dpkg -l |grep php5

结果

rc  php5-memcache                                   3.0.6-1                                             memcache extension module for PHP5
rc  php5-memcached                                  1.0.2-2                                             memcached extension module for PHP5, uses libmemcached
ii  php5-mysql                                      5.5.10+dfsg-1+deb.sury.org~precise+1                MySQL module for php5

php.ini 设置 .

;;;;;;;;;;;;;;;;;;;;;;;;;
;;   memchached        ;;
;;;;;;;;;;;;;;;;;;;;;;;;;

extension=/usr/lib/php5/20090626/memcache.so
extension=memcached.so
memcache.hash_strategy="consistent"

但是 phpinfo 没有显示 memchache 细节。和 php 脚本给出PHP Fatal error: Class 'Memcached' not found in


答案 1

php5-memcache并且未安装。在 dpkg 输出中表示软件包已被卸载,并且配置已保留。php5-memcached"rc"


答案 2

dpkg -l |grep php5 表示模块未安装

ii表示“它应该安装并安装”,而

rc表示“它已被删除/卸载,但它的配置文件仍然存在”


推荐