Installation

  1. Disable and remove any other caching plugin you may be using — most plugins have uninstall procedures you can follow. Make sure wp-content/ has 777 permissions (e.g.: # chmod 777 /var/www/vhosts/domain.com/httpdocs/wp-content/) before proceeding.
  2. Unzip and upload the plugin to your plugins directory (wp-content/plugins/) when done wp-content/plugins/w3-total-cache/ should exist. If you have WordPress MU you will need to install this in wp-content/mu-plugins/w3-total-cache/.
  3. Locate and activate the plugin on the Plugins page. Set the permisions of wp-content back to 755 (e.g.: # chmod 755 /var/www/vhosts/domain.com/httpdocs/wp-content/) and click through to the General Settings tab.
  4. Select your caching preferences for page, database and minify. If memcached is used this will require you to confirm or modify the default settings and add any additional memcached servers you wish to use. To utilize APC and memcached + memcache installation guides have been provided for those with virtual dedicated or dedicated servers. For those in shared hosting environments, contact your provider to see if either of these are supported.
  5. If you already have a content delivery network provider, proceed to the CDN Settings tab and populate the fields and set your preferences. If you're not running a version of WordPress with the Media Library feature, use the Media Library Import Tool to migrate your post images etc to appropriate locations.

    If you do not have a CDN provider, you can create and use a subdomain instead, e.g. subdomain.domain.com to improve server response, pipelining performance and progressive render.
  6. On the Minify Settings tab all of the recommended settings are preset. Specify any CSS and JS files in the respective sections, view your site's HTML source and search for .css and .js files. In the case of JS files you can determine the type and location of the embedding using the drop down menu. Avoid the inclusion of packed or obfuscated JS files in this step.
  7. Enable the plugin on the General Settings tab.
  8. You're done! Get back to blogging!
Check out the FAQ for more details on usage.

Server Preparation:
Time required: ~1 minute

  1. Install yum for your operating system if you don't already have it. If you like, you can update all of your installed software, but do so only if you have the experience and time to double check configurations afterwards:
    # yum -y update
  2. Install PECL:
    # yum -y install php-pear
  3. Install the PHP Development package:
    # yum -y install php-devel
  4. Install apxs with the following command:
    # yum -y install httpd-devel

Memcached (Daemon) Installation:
Time required: 3 minutes

  1. Try to install with yum:
    # yum -y install libevent

    If this succeeds skip to #5. If this fails, then let's compile. Download and extract the latest stable version:
    # cd /usr/local/src
    # wget http://monkey.org/~provos/libevent-1.4.12-stable.tar.gz
    # gunzip -c libevent-1.4.12-stable.tar.gz | tar xf -
    # cd libevent-1.4.12-stable
  2. Let's compile:
    # ./configure && make && make install
  3. In the output you should see:

    Libraries have been installed in:
    /usr/local/lib

    If so you can:
    # echo "/usr/local/lib/" > /etc/ld.so.conf.d/libevent.conf
  4. Configure your server for the new install:
    # ldconfig -v
  5. Now find the latest stable memcached, download and extract:
    # cd /usr/local/src
    # wget http://memcached.googlecode.com/files/memcached-1.4.0.tar.gz
    # gunzip -c memcached-1.4.0.tar.gz | tar xf -
    # cd memcached-1.4.0
  6. Let's compile:
    # ./configure && make && make install
  7. Make sure memcached is starts automatically on server boot:
    # touch /etc/init.d/memcached
    # echo '#!/bin/sh -e' >> /etc/init.d/memcached
    # echo '/usr/local/bin/memcached -d -m 128 -p 11211 -u nobody -l localhost' >> /etc/init.d/memcached
    # chmod u+x /etc/init.d/memcached
  8. And finally, let's start memcached:
    # /etc/init.d/memcached

For windows users we recommend checking the following sites for more installation tips:


PECL Memcache Module Installation:
Time required: 2 minutes

  1. Either use PECL (and skip to #4 if successful):
    # pecl install memcache
  2. Or via compilation. Download the latest stable version and extract:
    # cd /usr/local/src/
    # wget http://pecl.php.net/get/memcache-2.2.5.tgz
    # gunzip -c memcache-2.2.5.tgz | tar xf -
    # cd memcache-2.2.5
  3. Now we start to compile (and copy the module to your PECL modules directory if necessary):
    # phpize && ./configure && make && make install
    # cp -p /usr/local/src/memcache-2.2.5/modules/memcache.so /usr/lib/php/modules/
  4. Make sure the module is loaded:
    # echo "extension=memcache.so" > /etc/php.d/memcache.ini

    or you can also use the memcache.ini file we prepared for you:
    # cp -p /var/www/vhosts/domain.com/httpdocs/wp-content/plugins/w3-total-cache/ini/memcache.ini /etc/php.d/
  5. Finally restart apache:
    # /etc/init.d/httpd restart
  6. You're done! Memcache should now be available. If the following command retuns anything, you're all set:
    # php -r 'phpinfo();' | grep 'memcache'

APC Installation via Yum or PECL:
Time required: 1 minute

  1. Install APC using the PECL command:
    # pecl install apc

    or using yum:
    # yum -y install php-pecl-apc
  2. Make sure the module is loaded:
    # echo "extension=apc.so" > /etc/php.d/apc.ini

    or customize /etc/php.d/apc.ini using our included sample config file:
    # cp -p /var/www/vhosts/domain.com/httpdocs/wp-content/plugins/w3-total-cache/ini/apc.ini /etc/php.d/
  3. When ready, restart apache:
    # /etc/init.d/httpd restart
  4. You're done! APC should now be available. If the following command retuns anything, you're all set:
    # php -r 'phpinfo();' | grep 'apc'

For windows users we recommend checking the following sites for more installation tips:


APC Installation via Compilation:
Time required: 2 minutes

  1. Download the latest stable version and extract:
    # cd /usr/local/src
    # wget http://pecl.php.net/get/APC-3.0.19.tgz
    # gunzip -c APC-3.0.19.tgz | tar xf -
    # cd APC-3.0.19
  2. Note the paths returned for the following commands:
    # whereis phpize
    # whereis php-config
  3. Use the output from #2 to modify the --with-apxs and --with-php-config flags in the following compile command:
    # phpize && ./configure --enable-apc --enable-apc-mmap --with-apxs=/usr/bin/phpize --with-php-config=/usr/bin/php-config && make && make install

    The result should be similar to:
    Installing shared extensions: /usr/lib/php/modules/
  4. Use our customed APC settings by overwriting apc.ini in /etc/php.d/:
    # cp -p /var/www/vhosts/domain.com/httpdocs/wp-content/plugins/w3-total-cache/ini/apc.ini /etc/php.d/
  5. Restart apache when ready:
    # /etc/init.d/httpd restart
  6. You're done! APC should now be available. If the following command retuns anything, you're all set:
    # php -r 'phpinfo();' | grep 'apc'

Note(s):