Next Tutorial

Drupal 7 Tutorial Part 15: Drupal 7 Advanced Taxonomy Concepts

How to Install PHP APC on linux to improve drupal performance

Submitted by anilsagar on Fri, 02/26/2010 - 11:30

Hi Everyone,

Alternative PHP Cache (APC) is a free, open source framework that optimizes PHP intermediate code and caches data and compiled code from the PHP bytecode compiler in shared memory, which will save the compile time of php code and increases the drupal performance which is built using php.

In this article i am going to specify how to install and how to optimize the APC for Drupal.

Step 1:

To install APC we need PECL command. For this we need to install some packages. Run the below command to install php-pear, and php5-dev packages.
~$>sudo aptitude install php-pear
~$>sudo aptitude install php5-dev

Step 2:

We also need the apxs command, which is installed via the following package:

~$>sudo aptitude install apache2-dev

Step 3:

Lets install APC now.

~$>sudo pecl install apc

Step 4: Now we need to enable in APC in apache2 php.ini configuration file.

Open the file using the command. ~$>sudo gedit /etc/php5/apache2/php.ini

And add the line extension=apc.so

Now restart the apache using the command ~$>sudo /etc/init.d/apache2 restart

Now you are done. And you can see the improved performance of your drupal site :-)

Cheers,
Anil Sagar

©2010 AnilSagar. All rights reserved. Drupal theme by Kiwi Themes.