Speed up PHP with APC

Hello,

I’ve seen APC or Advanced Performance Cache help out quite a bit with a variety
of content management systems. Here is a fun install for you to do:

Download it

cd /usr/local/src
wget http://pecl.php.net/get/APC-3.1.2.tgz

Compile it

cd /usr/local/src/APC*
/usr/bin/phpize

Compile some more
./configure --enable-apc --enable-apc-mmap --with-apxs=/usr/local/apache/bin/apxs --with-php config=/usr/bin/php-config
make
make install

Take note of where it copies apc.so file i.e.
/usr/lib/php/extensions/no-debug-non-zts-/apc.so

You will want to add the following to your PHP.ini:


extension_dir="/usr/lib/php/extensions/no-debug-non-zts-/"
extension="apc.so"
apc.shm_size = 32

Test PHP to see if its working by running the following:

php -m

You should see the following listed:

[PHP Modules]
apc