1

I've been looking into Memcached / Memcache recently as a potential option for my work, and I've decided to use Memcached over Memcache. However, I noticed there's Memcached on the PHP website as well as Memcached.org's Memcached here. Are they the same thing? Do I need to install Memcached.org's memcached, or is that included in PHP?

The reason for my confusion is this answer on a Stack Overflow question that describes how there are two different Memcached libraries (both named the same thing).

Community
  • 1
  • 1
James Spence
  • 2,020
  • 1
  • 16
  • 23
  • Not the DV, but per the close reasons, "Questions asking us to recommend or find a book, tool, software library, **tutorial** or other off-site resource are off-topic for Stack Overflow." – LittleBobbyTables - Au Revoir Mar 09 '15 at 17:32
  • @LittleBobbyTables Would rewording the question to, "getting started with Memcached" or something along those lines be better? – James Spence Mar 09 '15 at 17:34
  • It's runs the risk of still being too broad, but it would at least be less off-topic :) – LittleBobbyTables - Au Revoir Mar 09 '15 at 17:39
  • 2
    Since this is a request for a tutorial, I think it is still off-topic. Can you be more specific about what you are stuck on? Is it installing memcache/memcached? Choose one, find the appropriate manual page, and try the example - I believe that's how I learned it. Just install to localhost - no need to set up remote servers yet. In terms of choosing between memcache and memcached, I think one is newer that the other - perhaps one or the other manual page will explain this. Lastly, what OS are you on? – halfer Mar 09 '15 at 17:44
  • 1
    @halfer According to the documentation, Memcached is considered an upgrade over Memcache, so I'm going with that. I guess my confusion is more whether the native [Memcached library in PHP](http://php.net/manual/en/book.memcached.php) is the same as [Memcached](http://memcached.org/). But you guys are both right, my question is extremely broad / badly phrased. I will revise it / the question title and update it. – James Spence Mar 09 '15 at 17:49
  • Okay, question completely reworded. Hopefully that takes me away from off-topic territory :) – James Spence Mar 09 '15 at 17:53
  • @halfer I develop on OSX, but (presumably), the service will be using a form of Ubuntu / Debian for its webserver. – James Spence Mar 09 '15 at 18:06
  • OK, cool. I think this is a good question now, by the way. You can either set up the Memcache server locally (e.g. via Homebrew or Macports), on a Linux virtual machine (e.g. on VirtualBox), or set up your whole dev environment in Vagrant (which can use one of several virtualisation providers). – halfer Mar 09 '15 at 21:59

1 Answers1

4

Nope, PHP's "memcached" is a PHP extension that provides an entryway into the memcached daemon (the real memcached, if you will)

rkok
  • 1,047
  • 14
  • 17
  • So what is [this Memcached](http://memcached.org/)? I presume it is using the libmemcached daemon as well? But what are the differences? – James Spence Mar 09 '15 at 17:59
  • That memcached is what it says it is: a free & open source, high-performance, distributed memory object caching system. This is the program that is actually pushing and retrieving data from memory. The "memcache" and "memcached" that you find in PHP are simply interfaces to help you use it when you're writing PHP code. Just like for instance the Ruby programming language has [its own memcached interface](https://rubygems.org/gems/memcached). – rkok Mar 09 '15 at 18:06
  • So if you want to use memcached in your PHP project, you need to (1) install the memcached daemon on your system, and then (2) install the memcached extension for PHP to communicate with it. – rkok Mar 09 '15 at 18:14