Install APC a PHP accelerator on ubuntu (8.04) server

This is the first step to boost your drupal site (or any other aplications using PHP). More ways to improve your site are to come.

APC (Alternative PHP Cache) is a PHP extension that will boost up your php scripts. It is part of PECL (a repository for PHP Extensions)

  1. First off all install apache2-threaded-dev with the following command:
    #apt-get install apache2-threaded-dev
  2. You will also need the package php5-dev (source needed for compiling additional modules)
    #apt-get install php5-dev
  3. Then install the apc extension with the pecl command:
    #pecl install apc
  4. The cleanest solution to include this extension into the php core is to create a file (for example:apc.ini) in the /etc/php5/cond.d directory.
    #cd /etc/php5/conf.d
    #touch apc.ini
    The minimal command in this file must be: extension=apc.so
  5. Restart your apache browswer.
  6. When you need to update your apc code simply use this command:
    #pecl upgrade apc

A very interessant benchmark has been made; APC has been compared with other 2 php accelerators.

For those of you using ubuntu 10.xx release of ubuntu, there is a package for the apc:

  1. #apt-get install php-apc

And that's it.

 

i am getting error as E:

i am getting error as
E: Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied)
E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options

                                               
88
""

888888888 88 ,adPPYb,d8 ,adPPYba,
a8P" 88 a8" `Y88 a8" ""
,d8P' 88 8b 88 8b
,d8" 88 "8a ,d88 "8a, ,aa
888888888 88 `"YbbdP'88 `"Ybbd8"'
,88 88
888P" 88
Enter the code depicted in ASCII art style.