Installing APC

For the last website I am working on, I figured I would try to setup a php accelerator (even though I don’t think it would really be required for the first few weeks after the launch).

So below are the steps I had to follow, on my Debian server.

Installation

1) PEAR, the php extension manager, must be installed

apt-get install php-pear

2) php-dev, which provide building tools (like phpize), also

apt-get install php-dev

3) apache2-dev, which provide apxs (used to build to apc module), as well

apt-get install apache2-dev

4) then finally, install apc

pecl install apc

PHP configuration

1) Enable the module in php.ini:

extension=apc.so

2) Set the following values

[apc]
apc.enabled=1
apc.shm_size=30
apc.ttl=7200
apc.user_ttl=7200

Results

A very quick test show me an improvement of the server-side processing time of a factor of about 2. (without any tweeking) Not bad!

I will probably play around a bit more in a few weeks.

sources:
http://fr3.php.net/apc
http://www.agnivo.com/tech/cache-php-scripts-with-apc-pecl-module-100.html

Tags: ,

Leave a Reply