Instalando APC y Memcache en Nginx y Ubuntu

Installing APC and Memcached on Ubuntu 12.04 with nginx

It’s very simple to do and well worth it:-

apt-get install php-apc

Now restart your PHP FPM service like so:-

/etc/init.d/php5-fpm restart

You can confirm that APC is now setup and running on your server by running this command:-

php -r "phpinfo();" | grep apc

You should see a load of output! – It is complains about invalid command etc. ensure you have the php5-cli package installed, this can be done like so:-

apt-get install php5-cli

Now we’ll move on to installing Memcached:-

apt-get install memcached

Now that memcached is installed we need to start the daemon like so:-

/etc/init.d/memcached start

Finally we need to install the PHP module for memcahced, let do it like so:-

apt-get install php5-memcached

All that is now required is to restart the PHP FPM daemon and then your done, you should now see significant speed increases in loading your PHP sites

/etc/init.d/php5-fpm restart

All done, enjoy the lovelyness of APC and Memchaced!

Drupal Memcache

Memcached has three components, the Memcached software, a PHP extension and the Drupal Memcache module that work together to provide in-memory storage of database calls or rendered pages which makes it very fast. The documentation on how to implement Memcached provides a good explanation of how to get up it and running, but if you need further help, the Drupal community is a great place to look.