19

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

result

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 setting .

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

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

but phpinfo not showing memchache details. and php script giving PHP Fatal error: Class 'Memcached' not found in

Saurabh Chandra Patel
  • 12,712
  • 6
  • 88
  • 78
  • Perhaps you are working in a autoloading namespaced environment [psr-0], try `\Memcached` wherever you are using it. – moonwave99 Apr 08 '14 at 15:46
  • 2
    `php5-memcache` and `php5-memcached` aren't installed. the "rc" in the dpkg output means, that the packages have been uninstalled, and that the configuration has been kept. – Pierre Sep 17 '14 at 16:39
  • `php -m` is good to see loaded modules – Tom Kay Aug 26 '15 at 16:00

4 Answers4

11

php5-memcache and php5-memcached aren't installed. the "rc" in the dpkg output means, that the packages have been uninstalled, and that the configuration has been kept.

Saurabh Chandra Patel
  • 12,712
  • 6
  • 88
  • 78
3

dpkg -l | grep php5 indicate that module is not install

ii means 'It should be installed and it is installed' whereas

rc means 'It's removed/uninstalled but it's configuration files are still there'

ansuman chauhan
  • 427
  • 2
  • 9
1

Use the following to install 'Memcache'

sudo apt-get install php5-memcache
Phill Healey
  • 3,084
  • 2
  • 33
  • 67
-2

Fatal error: Class 'Memcached' not found

the library might be missing, you can manually include the missing php_memcache into the ext folder

CinCout
  • 9,486
  • 12
  • 49
  • 67
Praveen
  • 1
  • 1
  • I have the same issue sucked with the mamcache error although i do "php_memcache.dll" in my windows7 machine at d:/xampp/php/ext (php version - 5.4.7) doesn't found the issue with the error that says, "Fatal error: Class 'Memcached' not found" – Praveen Mar 28 '16 at 10:17