I have just installed memcache on (not memcached) on Ubuntu 14.04 via

sudo pecl install memcache

the module is showing as loaded in phpinfo output.
But I cant see if the daemon is running.
I have tried

  • sudo ps -e | grep memcache
  • sudo ps -e | grep memcache
  • sudo service memcache status -> sudo: /etc/init.d/memcache: command not found
  • sudo /etc/init.d/memcache status -> memcache: unrecognized service

Most google searches give instructions for memcached which doesnt work for me

how can i check if memcache is running?

| improve this question | | | | |

You have only installed the PHP language bindings, which allow PHP to communicate with memcached. You haven't actually installed memcached. If you want to run memcached, you will need to install it. (And there is no such daemon as memcache.)

| improve this answer | | | | |
  • thanks, I wondered that, because they are written by different authors, I thought they were totally different packages which might clash if installed side by side. are you saying that they are meant to be run together , i.e. memcache provides API to PHP and memcached provide a utility purpose, like starting, stopping, status reporting etc? – the_velour_fog Mar 21 '15 at 1:59
  • They're just two completely different and incompatible language bindings for memcached. The one without the d is the older one and the one with the d is currently maintained. You should use whichever one the application you're deploying requires. It's also safe to install both. But note that data written to memcached with one can't be read by the other. – Michael Hampton Mar 21 '15 at 2:00
  • ah, so memcache is simply a PHP extension and not a daemon. memcached provides similar functionality but does run as a daemon/service? – the_velour_fog Mar 21 '15 at 2:02
  • 1
    Right, you need an actual memcached daemon to talk to. – Michael Hampton Mar 21 '15 at 2:03

Could it be your memcached binary is deleted or you haven't installed the memcached package yet?

➜ ~ which memcached
➜  ~  service memcached status
 * memcached is running
➜  ~  lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 14.04.2 LTS
Release:    14.04
Codename:   trusty
| improve this answer | | | | |
  • thanks, memcached is not being used in the project at all, the only reason I installed the older memcache is because I'm debugging a website that used it, so I'm trying to replicate the production environment as closely as possible. – the_velour_fog Mar 21 '15 at 2:09

First thing to do is check and see if the port is LISTENING

netstat -anp | grep LISTEN | grep mem

Next check to make sure it is not stalled

echo "stats" | nc localhost 11211 or what ever host/port yours is listening on.

source: https://briansnelson.com/Check_if_Memcached_is_Running

| improve this answer | | | | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.