Having Memcache and Memcached installed and enabled at the same time

joomlamemcachememcachedphp-memcachedphpbb

Can I use both Memcache and Memcached php extensions on the same server at the same time? Just to be clear so you dont misunderstand what I mean by this question, here is my scenario: I have both Joomla and phpbb for my website. Joomla provides support for both memcached and memcache where as phpbb only provides support for memcache. So I am planning to do this:

1) Install memcached server: apt-get install memcached

2) Install php-memcache to use for phpbb: apt-get install php5-memcache

3) Install php-memcached to use for Joomla: apt-get install php5-memcached

My questions are:

  1. Is it okay to have both memcache and memcached extensions installed
    and enabled where each of these are used by different php applications at the same time? Would
    this conflict in any ways?

  2. When I set the memory limit for the memcached server to 512M in
    /etc/memcached.conf, does it mean that this memory limit is going
    to be shared between both memcache and memcached extension? This
    shouldnt be a problem if say memcache uses more memory than
    memcached or vice versa? Do they both play nice to each other?

  3. In the scenario like this, should I try to give preference to only 1
    php extension (like either memcache only in my case) to keep things simple
    without conflicts between the two or it shouldnt matter. What I mean
    is, if you say it is okay to use both (for Q1), then out of
    professional practice, even if both can be used at the same time,
    should I still try to use the same php extension for both Joomla and
    phpbb if possible to minimize headaches? Would that make difference in any ways?

Best Answer

@Alin Andrei posted the right answer for this question. I am quoting him here since the answer is hidden in the comments. The credit goes to him:

1. memcache and memcached are two separate extensions that do not depend on each other so yes you can have them both installed. 

2. if both extensions use the same memcached server, then yes the memory is shared between them, you can keys from both extensions but only the size of 512 

3. if you can use the same extension on both apps then use only one to simplify the complexity you have. You could both of them as well, i dont think it will increase in size if you use both of them