1

I have project with plain php and in some part have $memcache = new Memcache; I debug and when beginning this line have fatal error - app die I check in my php info I have

memcached

memcached    support    enabled
             Version    2.2.0
libmemcached version    1.0.18

I check

ivan@ivan-PC:/usr/local/bin$ ps aux | grep memcached
ivan      2857  0.0  0.0  22804   960 pts/27   S+   13:44   0:00 grep --color=auto memcached
memcache 24913  0.0  0.0 325536  2160 ?        Ssl  11:55   0:00 /usr/bin/memcached -m 64 -p 11211 -u memcache -l 127.0.0.1

in log

Class 'Memcache' not found

in console I run memcache, but still app die. what need to do check ?

shuba.ivan
  • 3,824
  • 8
  • 49
  • 121
  • Sorry, I am a bit confused. "app dies", what app? Does PHP crash? Do you get any error logs? Is the only thing that causes the crashing is when you add that single line? – Iskar Jan 10 '17 at 11:44
  • Class 'Memcache' not found – shuba.ivan Jan 10 '17 at 11:46
  • Thanks for the edit! Is the PHP extension for memcache installed and loaded? Just having memcache system daemon doesn't give the ability to use `new Memcache;`. There are a lot of questions regarding that error message, do you get any resolution when searching on them? eg https://stackoverflow.com/q/2659035 – Iskar Jan 10 '17 at 12:09
  • I solved this problem when `sudo pecl install pecl_http-2.5.5` because need php version 5.6 and then in php info I find memcache and memcached – shuba.ivan Jan 10 '17 at 13:41

1 Answers1

2

Memcache and Memcached are two different libraries.

Your php info says you have installed memcached. Error says you are using memcache.

Try installing memcache and you should be fine.

mleko
  • 11,650
  • 6
  • 50
  • 71