Categories
Apps & OS's Coding

Installing APC and Memcached on Ubuntu 12.04 with nginx

Following on from one of my previous posts (Installing nginx on Ubuntu 12.04 as a high performance web server) I have installed APC and Memcached on my Ubuntu 12.04 server

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! 🙂