If you want to speed up your website, a good option (apart from code optimisation, HTTP request reduction and the likes) is to enable opcode caching on the server. Most blogs and other dynamic websites on the internet run with PHP. There are many PHP accelerators and APC is open source, pretty easy to install and has many configuration options.
For a heavy application consisting of a large source code base such as Drupal, you can expect around a 3x increase in page generation speed as a result. - List of PHP Accelerators on Wikipedia
First you need to install PEAR and dev packages, this is Ubuntu specific but similar on other platforms.
- apt-get install php-pear
- apt-get install php5-dev
- apt-get install make
- apt-get install apache2-prefork-dev
Once that’s done, install the APC module with pecl:
- pecl install apc
Go with the defaults, if you don’t know better. If the module has been succesfully installed, don’t forget to add the extension to your php.ini somewhere:
Now that you’ve installed APC, just restart your webserver (e.g. sudo service apache2 restart) and your PHP is now “accelerated”! APC provides a web interface with detailed information on the cache (memory usage, hits & misses, cache entries). By default it is not accessible so you need to copy the file /usr/share/php/apc.php to somewhere you can browse to.