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

后端 未结 2 865
暖寄归人
暖寄归人 2020-12-21 07:27

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 memcac

2条回答
  •  执念已碎
    2020-12-21 07:47

    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.

提交回复
热议问题