Installing memcached on a server for use with W3Total cache can seem daunting if you haven't done it before. Once you've done it enough to work out a method and know the speed bumps you can come across, you can
Use this command to determine the CentOS/RedHat version. You need this to know if you are working with version 4 5 or 6.
Use this command to determine if the OS is 64bit or 32bit (look for x64 if it is not there, 99% of the time you're on 32 bit)
Retrieve the IUS Community repository installation files to allow an easy install of the memcache module from the IUS repo.
NOTE: These are examples for 64 bit Redhat 5. Browse the repo at http://dl.iuscommunity.org/pub/ius/stable/Redhat/ to make certain you have the right files for your server: (current as of 10/10/12)
NOTE: These ALTERNATE examples are for 32 bit Redhat 5. Browse the repo at http://dl.iuscommunity.org/pub/ius/stable/Redhat/ to make certain you have the right files for your server: (current as of 10/10/12)
Install both of these files:
rpm -Uvh *-release-*.rpm
Perform the install:
yum -y install memcached
service memcached start
chkconfig memcached on
pecl install memcache
Note: If you get a "Can't compile c code" error, try making your tmp folder executible before running the pecl command:
mount -o,remount,rw,exec /var/tmp
Make sure you remount the tmp directory securely with noexec when you are done:
mount -o,remount,rw,noexec /var/tmp
Make sure this line has correctly been added to the php.ini file for your site:
Sometimes the php.ini file has been overridden for a specific directory. Look for that if phpinfo() tells you memcache is not active. This picture shows a site with the default php.ini overridden by a local copy. It required the extension line to be manually added to the overriding ini file.