Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.1k views
in Technique[技术] by (71.8m points)

php - I'm Confused with Memcache vs Memcached vs php5-memcache

I followed the instruction in this tutorial on how to install nginx, php, and mysql including the php5-memcache.

I'm wondering if I still need to install the memcache or memcached without the "php5" prefix .

As of now my WordPress site is complaining the ff:

The following memcached servers are not responding or not running:

Page Cache: 127.0.0.1:11211.
Database Cache: 127.0.0.1:11211.
Object Cache: 127.0.0.1:11211.
This message will automatically disappear once the issue is resolved.

If it is needed to be installed, will it not conflict with php5-memcache? Or something like an overkill usage of the two version?

And what is the best version to use? Memcache or Memcached? php5-memcache or php5-memcached.

I heard that memcached with "d" is just a service or daemon. But somebody is trying to compare the two as what I have seen here.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

The names of these extensions are confusing.

Actually, both php5-memcache and php5-memcached are PHP extensions for working with the memcached service (Memcached server). They both give your PHP processes, the ability to be clients to the memcached service, i.e. to connect to memcached over the network, and to speak the memcached protocol, in order to use the memcached API.

The php5-memcached extension is more stable and has more features in my opinion, so I would suggest, that it should be tried first. Most of its operations are faster too (php source for the benchmark that produced these results).

You still do need the actual memcached service started somewhere, and its address, in order to connect to it. The memcached service may be started on the same host, or on another host/hosts, if you want a distributed cache.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...