Support / KnowledgeBase

 
Search the KnowledgeBase Search

Installing memcached

  • Applies to: (dpv) Nitro, (dv) 3.5

  • Difficulty: Medium

  • Time needed: 5 minutes

  • Tools needed: SSH, Developer Tools, Yum

 

This article will show you how to install memcached on a (dv) Dedicated-Virtual 3.5 Server.

  1. First you must install the Developer Tools, and Yum Package Manager.

    TIP:

    It may be a good idea to update your system with yum update command before continuing.

  2. Grab the Files and install using yum:

    wget http://dag.wieers.com/rpm/packages/rpmforge-release/rpmforge-release-0.3.6-1.el5.rf.i386.rpm
    rpm --install rpmforge-release-0.3.6-1.el5.rf.i386.rpm
    yum install --enablerepo=rpmforge memcached
    
  3. Start memcached:

    NOTE:

    The "-m SIZE" is the flag for setting the memory requirements in MBs.  Once this cache is filled memcache will just start to overwrite with newer content.  Please experiment with this setting to find what works best for you.


     memcached -d -m 512 -l 127.0.0.1 -p 11211 -u nobody
  4. Grab the memcache PHP extension:
     wget http://pecl.php.net/get/memcache-2.2.5.tgz
  5. Untar the file:
     tar -xvf memcache-2.2.5.tgz
  6. Open the directory:
     cd memcache-2.2.5
  7. Install the memcached PHP extension:
     phpize && ./configure --enable-memcache && make
  8. Copy the extension:
     cp /root/memcache-2.2.5/modules/memcache.so /usr/lib/php/modules/
  9. Edit your php.ini:
     vi /etc/php.ini
  10. Add extension=memcache.so:
     extension=memcache.so
  11. Restart Apache:
     /etc/init.d/httpd restart
  12. If you check your server using a phpinfo page you should now see a MemCache section on the page. You can now fully use the MemCache functionality in your PHP.



Notes/Supplemental Resources:


Revisions:

07-27-2009: Article Creation, thanks Seetha!




User Comments

No visitor comments posted. Post a comment

Fields marked with an asterisk(*) are required. Comment on this article

Fill out the form below if you would like to comment on this article.
 
 
 

(code is not case-sensitive)
 
Submit
 
 

Continue