Installing APC On Ubuntu 8.04 Hardy Heron

October 26th, 2008  

If you’ve got your own VPS or dedicated server and are looking for a way to cache your PHP code and make your blog run faster, then look no further than Alternative PHP Cache (APC). It’s a breeze to install APC on Ubuntu 8.04 Hardy Heron. It takes just a few simple commands and you are set.

First off, you need to update your apt-get files so run the command:
sudo apt-get update

Next, you need to install the dev files that will prepare your server to install APC.
sudo apt-get install php5-dev php-pear apache2-threaded-dev

Once you are done with those, now it is time to install APC itself. Once again from your SSH shell, run this command:
pecl install apc

You’ll be given an installation option, just hit enter to continue.

Next, you need to tell your PHP file just where your APC extension is. For this, you’ll need to copy and paste some code and stick it into your php.ini file.

So, copy this code:
extension = apc.so
apc.enabled = 1
apc.shm_size = 48
apc.include_once_override = 1
apc.mmap_file_mask = /tmp/apc.XXXXXX

Next open your php.ini file:
nano /etc/php5/apache2/php.ini

At the top of the file just paste the code. All that is left to do is to enable it. Just restart apache with this command:
/etc/init.d/apache2 restart

You now have a working PHP cache. You will reduce your server load and serve up your pages even faster.

Posted in Blog Servers |

Tags: , , ,

Bookmark Add to Mixx!

No Comments Received

Leave A Reply

Please Note: All comments are held back to check for spam so be patient. They will be approved.